Skip to content

CLI: non-interactive mode for capsule export#13

Closed
Angelmmiguel wants to merge 1 commit intomainfrom
rover/task-2-vY5Dnds6wVJS
Closed

CLI: non-interactive mode for capsule export#13
Angelmmiguel wants to merge 1 commit intomainfrom
rover/task-2-vY5Dnds6wVJS

Conversation

@Angelmmiguel
Copy link
Copy Markdown
Contributor

Summary

  • Migrates CLI argument parsing from manual process.argv handling to commander, defining all subcommands (share, export, serve) as proper commander commands
  • Adds --output, --anonymize, and --format flags to capsule export (and partially to share) for fully non-interactive usage in CI/scripts
  • Extends session resolution to support agent:sessionId shorthand (e.g., claude:abc123) in addition to file paths
  • In non-TTY environments, commands run fully headless with sensible defaults (--anonymize all, auto-generated output name), failing early if required info is missing
  • Existing interactive behavior remains unchanged when no flags are passed in a TTY

Closes #11

Changes

  • packages/cli/src/index.ts — Replaced manual argv parsing with commander program and subcommand definitions
  • packages/cli/src/commands/export.ts — Added --output, --anonymize, --format options; non-interactive mode support
  • packages/cli/src/commands/share.ts — Adapted to commander; added --format and --anonymize options
  • packages/cli/src/commands/serve.ts — Adapted to commander
  • packages/cli/src/flows/session.ts — Added agent:id shorthand resolution, format flag fallback, non-TTY error handling
  • packages/cli/src/flows/anonymize-prompt.ts — Accept pre-selected anonymization options, skip prompt when fully specified
  • packages/cli/package.json — Added commander dependency
  • pnpm-lock.yaml — Updated lockfile

Replace manual process.argv parsing with commander for subcommand
routing, option parsing, and help/version generation. Refactor
resolveSession() to support agent:sessionId specifiers and dual-mode
(interactive/non-interactive) operation. Add resolveAnonymization()
with --anonymize flag support (all/none/comma-separated keys). The
export command now works in non-TTY contexts with --output, --format,
and --anonymize flags.

Co-Authored-By: Rover <noreply@endor.dev>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
capsule e55a6fd Commit Preview URL

Branch Preview URL
Feb 23 2026, 11:32 AM

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.

CLI: non-interactive mode for capsule export

1 participant