Skip to content

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

Merged
peg merged 1 commit into
mainfrom
refactor/split-cli
May 1, 2026
Merged

refactor(cli): split 2582-line cli.go into per-command files#37
peg merged 1 commit into
mainfrom
refactor/split-cli

Conversation

@peg

@peg peg commented Mar 25, 2026

Copy link
Copy Markdown
Owner

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 <[email protected]>
@peg
peg merged commit 7215a6b into main May 1, 2026
1 check passed
@peg
peg deleted the refactor/split-cli branch May 1, 2026 19:15
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