refactor: migrate legacy standalone CLI tools to CliFramework #235

Closed
opened 2026-05-31 14:20:09 +00:00 by jmiller · 2 comments
Owner

Problem

Only 19 of 98 tools (19%) extend CliFramework. The remaining 79 are standalone scripts with:

  • Manual argv parsing
  • No --help support
  • No --json output
  • Inconsistent error handling
  • No input validation

Scope

By directory:

  • cli/ - 47 of 48 tools are standalone (only joomla_release.php uses CliFramework)
  • automation/ - all 9 standalone
  • maintenance/ - all 8 standalone
  • deploy/ - all 7 standalone
  • fix/ - all 4 standalone
  • release/ - both standalone
  • validate/ - fully migrated (model directory)

Approach

Incremental migration, prioritizing:

  1. Most-used tools first (release, version:bump, build:package)
  2. Tools being registered in COMMAND_MAP (related issues)
  3. Remaining tools

Template

Each migration follows the pattern in CLAUDE.md:

class MyTool extends CliFramework {
    protected function configure(): void { ... }
    protected function run(): int { ... }
}

Acceptance Criteria

  • All tools extend CliFramework
  • All tools support --help, --verbose, --quiet, --dry-run
  • Exit codes standardized (0=success, 1=failure, 2=usage)
  • No functionality regression
## Problem Only 19 of 98 tools (19%) extend CliFramework. The remaining 79 are standalone scripts with: - Manual argv parsing - No --help support - No --json output - Inconsistent error handling - No input validation ## Scope **By directory:** - cli/ - 47 of 48 tools are standalone (only joomla_release.php uses CliFramework) - automation/ - all 9 standalone - maintenance/ - all 8 standalone - deploy/ - all 7 standalone - fix/ - all 4 standalone - release/ - both standalone - validate/ - fully migrated (model directory) ## Approach Incremental migration, prioritizing: 1. Most-used tools first (release, version:bump, build:package) 2. Tools being registered in COMMAND_MAP (related issues) 3. Remaining tools ## Template Each migration follows the pattern in CLAUDE.md: ```php class MyTool extends CliFramework { protected function configure(): void { ... } protected function run(): int { ... } } ``` ## Acceptance Criteria - [ ] All tools extend CliFramework - [ ] All tools support --help, --verbose, --quiet, --dry-run - [ ] Exit codes standardized (0=success, 1=failure, 2=usage) - [ ] No functionality regression
jmiller added the phppriority: low labels 2026-05-31 14:20:09 +00:00
Author
Owner

Branch created: feature/235-refactor-migrate-legacy-standalone-cli-t

git fetch origin
git checkout feature/235-refactor-migrate-legacy-standalone-cli-t
Branch created: [`feature/235-refactor-migrate-legacy-standalone-cli-t`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/235-refactor-migrate-legacy-standalone-cli-t) ```bash git fetch origin git checkout feature/235-refactor-migrate-legacy-standalone-cli-t ```
Author
Owner

Completed in v09.22.00.

  • 64 legacy scripts migrated to CliFramework across cli/, automation/, maintenance/, deploy/, release/
  • 2 CLIApp subclasses converted to extend CliFramework directly
  • All 5,106 PHPCS violations fixed (PSR-12 clean)
  • All 99 commands pass --help smoke test
  • All 22 CliDispatchTest assertions pass

Commits: b3d9ee8, 66e728b

Completed in v09.22.00. - 64 legacy scripts migrated to CliFramework across cli/, automation/, maintenance/, deploy/, release/ - 2 CLIApp subclasses converted to extend CliFramework directly - All 5,106 PHPCS violations fixed (PSR-12 clean) - All 99 commands pass --help smoke test - All 22 CliDispatchTest assertions pass Commits: b3d9ee8, 66e728b
Sign in to join this conversation.
No labels php priority: low
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#235