---
actual_hours: null
assignees: []
created_at: '2025-08-20T09:24:36.844732'
dependencies: []
description: 'Migrate existing CLI commands to use the new shared utilities and base
  classes.


  ## Scope

  Refactor 15+ CLI commands to use shared utilities:

  - agents.py, config.py, memory.py, tickets.py, mcp.py, monitor.py, etc.

  - Replace duplicate argument parsing with shared patterns

  - Standardize error handling and output formatting

  - Implement BaseCommand inheritance


  ## Target Duplication Reduction

  - CLI Commands: 80% duplicate patterns → ~15% (65% reduction)

  - Estimated 40-60% code reduction per command file


  ## Deliverables

  - All CLI commands refactored to use shared utilities

  - Consistent argument parsing across all commands

  - Standardized error handling and exit codes

  - Uniform output formatting (JSON, YAML, table, text)

  - Updated tests for refactored commands


  ## Dependencies

  - Requires Phase 1 (Foundation) to be completed

  - Should be done before Phase 3 (Service Migration)


  ## Estimated Effort

  2-3 hours for complete migration of all CLI commands


  ## Success Criteria

  - All CLI commands use BaseCommand or shared utilities

  - No duplicate argument parsing patterns

  - Consistent error handling across all commands

  - All tests pass after refactoring'
due_date: null
estimated_hours: null
id: ISS-0007
labels: []
metadata:
  closed_at: '2025-08-20T12:54:13.199113'
  component: null
  github_id: I_kwDOPScCe87HFeU7
  github_url: https://github.com/bobmatnyc/claude-mpm/issues/68
  issue_type: feature
  labels: []
  platform: github
  relates_to: null
  reported_by: null
  resolution: null
  severity: high
  type: issue
parent: EP-0002
priority: high
status: completed
tags:
- issue
- feature
title: 'Phase 2: CLI Command Migration'
updated_at: '2025-08-20T22:54:40.464515'
---

# Phase 2: CLI Command Migration

## Description
Migrate existing CLI commands to use the new shared utilities and base classes.

## Scope
Refactor 15+ CLI commands to use shared utilities:
- agents.py, config.py, memory.py, tickets.py, mcp.py, monitor.py, etc.
- Replace duplicate argument parsing with shared patterns
- Standardize error handling and output formatting
- Implement BaseCommand inheritance

## Target Duplication Reduction
- CLI Commands: 80% duplicate patterns → ~15% (65% reduction)
- Estimated 40-60% code reduction per command file

## Deliverables
- All CLI commands refactored to use shared utilities
- Consistent argument parsing across all commands
- Standardized error handling and exit codes
- Uniform output formatting (JSON, YAML, table, text)
- Updated tests for refactored commands

## Dependencies
- Requires Phase 1 (Foundation) to be completed
- Should be done before Phase 3 (Service Migration)

## Estimated Effort
2-3 hours for complete migration of all CLI commands

## Success Criteria
- All CLI commands use BaseCommand or shared utilities
- No duplicate argument parsing patterns
- Consistent error handling across all commands
- All tests pass after refactoring

## Details
- **Status**: completed
- **Priority**: high
- **Assignees**: None
- **Tags**: issue, feature
- **Created**: 2025-08-20 09:24:36
- **Updated**: 2025-08-20 22:54:40

## Tasks
- [ ] Add task items here

## Notes
_Add any additional notes or context here._
