MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / parseAutonomyArgs

Function parseAutonomyArgs

src/utils/autonomyCommandSpec.ts:18–44  ·  view source on GitHub ↗
(args: string)

Source from the content-addressed store, hash-verified

16 | { type: 'usage' }
17
18export function parseAutonomyArgs(args: string): ParsedAutonomyCommand {
19 const [subcommand = 'status', arg1, arg2] = args.trim().split(/\s+/, 3)
20
21 if (subcommand === '' || subcommand === 'status') {
22 return { type: 'status', deep: arg1 === '--deep' }
23 }
24
25 if (subcommand === 'runs') {
26 return { type: 'runs', limit: arg1 }
27 }
28
29 if (subcommand === 'flows') {
30 return { type: 'flows', limit: arg1 }
31 }
32
33 if (subcommand === 'flow') {
34 if (arg1 === 'cancel') {
35 return arg2 ? { type: 'flow-cancel', flowId: arg2 } : { type: 'usage' }
36 }
37 if (arg1 === 'resume') {
38 return arg2 ? { type: 'flow-resume', flowId: arg2 } : { type: 'usage' }
39 }
40 return arg1 ? { type: 'flow-detail', flowId: arg1 } : { type: 'usage' }
41 }
42
43 return { type: 'usage' }
44}

Callers 2

getAutonomyCommandTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected