MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / build_parser

Function build_parser

claw-code/src/main.py:21–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def build_parser() -> argparse.ArgumentParser:
22 parser = argparse.ArgumentParser(description='Python porting workspace for the Claude Code rewrite effort')
23 subparsers = parser.add_subparsers(dest='command', required=True)
24 subparsers.add_parser('summary', help='render a Markdown summary of the Python porting workspace')
25 subparsers.add_parser('manifest', help='print the current Python workspace manifest')
26 subparsers.add_parser('parity-audit', help='compare the Python workspace against the local ignored TypeScript archive when available')
27 subparsers.add_parser('setup-report', help='render the startup/prefetch setup report')
28 subparsers.add_parser('command-graph', help='show command graph segmentation')
29 subparsers.add_parser('tool-pool', help='show assembled tool pool with default settings')
30 subparsers.add_parser('bootstrap-graph', help='show the mirrored bootstrap/runtime graph stages')
31 list_parser = subparsers.add_parser('subsystems', help='list the current Python modules in the workspace')
32 list_parser.add_argument('--limit', type=int, default=32)
33
34 commands_parser = subparsers.add_parser('commands', help='list mirrored command entries from the archived snapshot')
35 commands_parser.add_argument('--limit', type=int, default=20)
36 commands_parser.add_argument('--query')
37 commands_parser.add_argument('--no-plugin-commands', action='store_true')
38 commands_parser.add_argument('--no-skill-commands', action='store_true')
39
40 tools_parser = subparsers.add_parser('tools', help='list mirrored tool entries from the archived snapshot')
41 tools_parser.add_argument('--limit', type=int, default=20)
42 tools_parser.add_argument('--query')
43 tools_parser.add_argument('--simple-mode', action='store_true')
44 tools_parser.add_argument('--no-mcp', action='store_true')
45 tools_parser.add_argument('--deny-tool', action='append', default=[])
46 tools_parser.add_argument('--deny-prefix', action='append', default=[])
47
48 route_parser = subparsers.add_parser('route', help='route a prompt across mirrored command/tool inventories')
49 route_parser.add_argument('prompt')
50 route_parser.add_argument('--limit', type=int, default=5)
51
52 bootstrap_parser = subparsers.add_parser('bootstrap', help='build a runtime-style session report from the mirrored inventories')
53 bootstrap_parser.add_argument('prompt')
54 bootstrap_parser.add_argument('--limit', type=int, default=5)
55
56 loop_parser = subparsers.add_parser('turn-loop', help='run a small stateful turn loop for the mirrored runtime')
57 loop_parser.add_argument('prompt')
58 loop_parser.add_argument('--limit', type=int, default=5)
59 loop_parser.add_argument('--max-turns', type=int, default=3)
60 loop_parser.add_argument('--structured-output', action='store_true')
61
62 flush_parser = subparsers.add_parser('flush-transcript', help='persist and flush a temporary session transcript')
63 flush_parser.add_argument('prompt')
64
65 load_session_parser = subparsers.add_parser('load-session', help='load a previously persisted session')
66 load_session_parser.add_argument('session_id')
67
68 remote_parser = subparsers.add_parser('remote-mode', help='simulate remote-control runtime branching')
69 remote_parser.add_argument('target')
70 ssh_parser = subparsers.add_parser('ssh-mode', help='simulate SSH runtime branching')
71 ssh_parser.add_argument('target')
72 teleport_parser = subparsers.add_parser('teleport-mode', help='simulate teleport runtime branching')
73 teleport_parser.add_argument('target')
74 direct_parser = subparsers.add_parser('direct-connect-mode', help='simulate direct-connect runtime branching')
75 direct_parser.add_argument('target')
76 deep_link_parser = subparsers.add_parser('deep-link-mode', help='simulate deep-link runtime branching')
77 deep_link_parser.add_argument('target')
78

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected