Skip to content

Refactor CLI command handlers#383

Merged
chubes4 merged 1 commit into
mainfrom
refactor/cli-command-handlers
May 31, 2026
Merged

Refactor CLI command handlers#383
chubes4 merged 1 commit into
mainfrom
refactor/cli-command-handlers

Conversation

@chubes4
Copy link
Copy Markdown
Collaborator

@chubes4 chubes4 commented May 31, 2026

Summary

  • Advances Move CLI command implementations out of index.ts #374 by moving the runtime, discovery, workspace-policy, and artifacts command handlers out of packages/cli/src/index.ts into focused packages/cli/src/commands/* modules.
  • Keeps the CLI router wiring in index.ts while preserving existing command names, option parsing, JSON output, and help behavior for the extracted slice.
  • Leaves the larger recipe-run implementation in index.ts for a separate follow-up slice to keep this PR focused.

Tests

  • npm run build
  • node packages/cli/dist/index.js help
  • node packages/cli/dist/index.js commands --json
  • node packages/cli/dist/index.js schema recipe --json
  • node packages/cli/dist/index.js recipe validate --recipe examples/recipes/simple-plugin.json --json
  • node packages/cli/dist/index.js recipe-run --recipe examples/recipes/simple-plugin.json --dry-run --json
  • node packages/cli/dist/index.js validate-blueprint --blueprint '{"steps":[]}' --json
  • node packages/cli/dist/index.js run --mount ./examples/simple-plugin:/wordpress/wp-content/plugins/simple-plugin --command wordpress.run-php --arg code-file=./examples/simple-plugin/probe.php --artifacts ./artifacts --json
  • npm run workspace-policy-smoke
  • npm run discovery-command-smoke
  • npm run recipe-dry-run-smoke

Caveats

  • npm install was required because the fresh worktree did not have node_modules; incidental package-lock.json version churn was reverted.
  • recipe-run and recipe validate internals remain in index.ts; this PR intentionally extracts only a coherent non-recipe command slice.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (openai/gpt-5.5)
  • Used for: Refactoring the CLI command handlers, running focused verification, and drafting this PR description for Chris to review.

@chubes4 chubes4 merged commit 211109f into main May 31, 2026
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.

1 participant