Skip to content

Conversation

@zhubert
Copy link
Owner

@zhubert zhubert commented Jan 26, 2026

Summary

Replaces the manual flag parsing in main.go with the Cobra command framework, improving CLI structure, help generation, and maintainability.

Changes

  • Add spf13/cobra dependency for command-line parsing
  • Create cmd/ package with modular command structure:
    • root.go - Root command with TUI startup and global --debug flag
    • clean.go - New unified clean command (replaces --clear and --prune)
    • mcp_server.go - Internal MCP server subcommand
    • demo.go - Demo generation subcommands
  • Consolidate --clear and --prune flags into single plural clean command with confirmation prompt
  • Add -y/--yes flag to skip confirmation in clean command
  • Remove --check-prereqs flag (prerequisites still validated on TUI startup)
  • Simplify main.go to just call cmd.Execute()
  • Update CLAUDE.md documentation with new CLI usage

Test plan

  • Run go test ./... to verify all tests pass
  • Run plural --help to verify help output
  • Run plural --version to verify version display
  • Run plural clean and verify confirmation prompt appears
  • Run plural clean -y to verify skip confirmation works
  • Run plural demo list to verify demo subcommand works
  • Run plural to verify TUI starts normally

Replaces manual flag parsing with Cobra for better command organization, subcommand handling, and automatic help generation. Moves command implementations into dedicated files under cmd/.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

🔍 Deadcode Analysis

✅ No unreachable functions detected. Nice work keeping the codebase clean!

@zhubert zhubert merged commit 02f6842 into main Jan 26, 2026
2 checks passed
@zhubert zhubert deleted the simplify-cli branch January 26, 2026 20:41
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.

2 participants