Skip to content

Add CLI argument parsing for core config options #2

@fveracoechea

Description

@fveracoechea

What to build

Add CLI argument parsing so users can override core configuration options via command-line flags instead of relying solely on agent-loop.config.ts. This makes the tool more ergonomic for one-off runs and CI environments.

The loop currently only reads from agent-loop.config.ts (or uses hardcoded defaults). Users should be able to pass flags like --source-branch, --target-branch, --max-iterations, and --dry-run directly on the command line, with flags taking precedence over the config file.

Acceptance criteria

  • Parse CLI arguments using a lightweight approach (e.g., process.argv with manual parsing, or Bun's built-in parseArgs).
  • Supported flags:
    • --source-branch <branch> — overrides config.sourceBranch
    • --target-branch <branch> — overrides config.targetBranch
    • --max-iterations <number> — overrides config.maxIterations
    • --dry-run — enables dry-run mode (see separate issue)
  • CLI flags take precedence over agent-loop.config.ts, which takes precedence over defaults.
  • Unknown flags are rejected with a clear error message.
  • Tests cover precedence logic and flag parsing edge cases (e.g., invalid --max-iterations value).
  • bun lint:ci, bun typecheck, and bun test pass after changes.

Blocked by

None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions