Skip to content

refactor: implement command registry pattern to eliminate boilerplate - #26

Merged
ccmdi merged 3 commits into
masterfrom
claude/brainstorm-llm-features-012fA9qvDF7AJT2BycR6Jorm
Nov 19, 2025
Merged

refactor: implement command registry pattern to eliminate boilerplate#26
ccmdi merged 3 commits into
masterfrom
claude/brainstorm-llm-features-012fA9qvDF7AJT2BycR6Jorm

Conversation

@ccmdi

@ccmdi ccmdi commented Nov 19, 2025

Copy link
Copy Markdown
Owner
  • Commands now self-register via COMMAND export pattern
  • Each command file defines its own argparse setup
  • Eliminated 127 lines (48%) from main.py (263 -> 136 lines)
  • Zero manual imports or routing logic in main.py

Changes:

  • Add setup_parser() and COMMAND export to all command files
  • Create commands/init.py with ALL_COMMANDS registry
  • Add new edit_cmd.py wrapper for edit mode
  • Simplify main.py to auto-register and auto-dispatch commands

claude and others added 3 commits November 19, 2025 21:22
Major DX improvements to CLI architecture:

- Commands now self-register via COMMAND export pattern
- Each command file defines its own argparse setup
- Eliminated 127 lines (48%) from main.py (263 -> 136 lines)
- Zero manual imports or routing logic in main.py

Changes:
- Add setup_parser() and COMMAND export to all command files
- Create commands/__init__.py with ALL_COMMANDS registry
- Add new edit_cmd.py wrapper for edit mode
- Simplify main.py to auto-register and auto-dispatch commands

Adding new commands now requires:
1. Create command file with setup_parser/handler/COMMAND
2. Add one import line to commands/__init__.py
3. Done - no main.py changes needed
@ccmdi
ccmdi merged commit e0a9045 into master Nov 19, 2025
1 check passed
@ccmdi
ccmdi deleted the claude/brainstorm-llm-features-012fA9qvDF7AJT2BycR6Jorm branch November 19, 2025 21:44
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