Skip to content

[Refactoring] Split CLI Commands into Domain Modules #14

@gloomcheng

Description

@gloomcheng

Problem

`src/cli/mcp-commands.ts` is 720 lines with all CLI commands in one file.

Impact

  • Hard to find specific commands
  • Difficult to maintain
  • No clear separation of concerns

Proposed Solution

Split by Domain

```
cli/
commands/
server.ts (MCP server commands - start, stop, restart)
workflow.ts (workflow commands - spec, plan, implement)
memory.ts (memory commands - learn, context, correct)
release.ts (release commands - release, version)
team.ts (team commands - share, view, learn-pr)
index.ts (command registration)
```

Benefits

Clarity: Commands grouped by domain
Maintainability: Easier to find and modify
Testability: Each domain can be tested independently
Extensibility: Easy to add new domains

Acceptance Criteria

  • mcp-commands.ts split into 5-6 domain files
  • Each file <150 lines
  • All commands still work
  • Tests updated
  • Documentation updated

Priority

🟡 High

Effort Estimate

1 day

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions