Refactor CLI to use Cobra command framework #90
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the manual flag parsing in main.go with the Cobra command framework, improving CLI structure, help generation, and maintainability.
Changes
spf13/cobradependency for command-line parsingcmd/package with modular command structure:root.go- Root command with TUI startup and global--debugflagclean.go- New unifiedcleancommand (replaces--clearand--prune)mcp_server.go- Internal MCP server subcommanddemo.go- Demo generation subcommands--clearand--pruneflags into singleplural cleancommand with confirmation prompt-y/--yesflag to skip confirmation incleancommand--check-prereqsflag (prerequisites still validated on TUI startup)cmd.Execute()Test plan
go test ./...to verify all tests passplural --helpto verify help outputplural --versionto verify version displayplural cleanand verify confirmation prompt appearsplural clean -yto verify skip confirmation worksplural demo listto verify demo subcommand workspluralto verify TUI starts normally