Skip to content

Move CLI command implementations out of index.ts #374

@chubes4

Description

@chubes4

Goal

Make packages/cli/src/index.ts a CLI bootstrap plus command wiring surface, not a container for command implementation.

Current Problem

The command router exists, but index.ts still contains many command handlers and support functions. This keeps CLI behavior harder to scan, review, and extend.

Target Shape

  • index.ts owns bootstrap, shared setup, and exports only minimal CLI entry points.
  • Command implementations live under focused modules, likely packages/cli/src/commands/.
  • Existing helper modules (recipe-*, agent-sandbox, runtime-command-wrappers, output) remain the lower-level building blocks.

Candidate Slices

  • commands/recipe.ts
  • commands/recipe-run.ts
  • commands/schema.ts
  • commands/run.ts
  • commands/boot.ts
  • commands/list.ts or equivalent for discovery/registry output

Acceptance Criteria

  • index.ts is materially smaller and readable as CLI bootstrap/orchestration.
  • Command behavior, option parsing, JSON output, and help/unknown-command behavior remain unchanged.
  • Build and focused CLI command/recipe smokes pass.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (openai/gpt-5.5)
  • Used for: Drafting this tracker from the current architecture cleanup state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions