Skip to content

refactor(cli): split 2582-line cli.go into per-command files#37

Open
peg wants to merge 1 commit intomainfrom
refactor/split-cli
Open

refactor(cli): split 2582-line cli.go into per-command files#37
peg wants to merge 1 commit intomainfrom
refactor/split-cli

Conversation

@peg
Copy link
Copy Markdown
Owner

@peg peg commented Mar 25, 2026

Pure mechanical split — no logic changes, no behavior changes.

File Lines Contents
cli.go ~200 package entry, Run(), usage, shared helpers
cmd_arming.go ~260 cmdArm, runSelectTUI, select TUI types
cmd_plant.go ~141 cmdPlant, plantOne, cmdTeardown
cmd_scan.go ~293 cmdScan, scan types, scan logic
cmd_events.go ~303 cmdEvents, summary, ASN helpers
cmd_config.go ~207 cmdConfig, cmdDoctor, cmdTest
cmd_status.go ~350 cmdStatus, cmdDisarm, cmdRotate, cmdInit, cmdUninstall
cmd_serve.go ~340 cmdServe

All existing tests pass. go build ./... clean.

Pure mechanical split — no behavior, signature, or logic changes.
cli.go (528 lines) retains the dispatcher, shared helpers, and buildParams.
Command groups moved to: cmd_arming.go, cmd_plant.go, cmd_scan.go,
cmd_events.go, cmd_status.go, cmd_config.go, cmd_serve.go.

Note: "arm" command lives in cmd_arming.go (not cmd_arm.go) because
Go treats the _arm filename suffix as a GOARCH=arm build constraint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant