Skip to content

fix(external-cli): passthrough help and version flags#38

Open
chtangwin wants to merge 1 commit intonashsu:mainfrom
chtangwin:feature/external-cli-help-passthrough-clean
Open

fix(external-cli): passthrough help and version flags#38
chtangwin wants to merge 1 commit intonashsu:mainfrom
chtangwin:feature/external-cli-help-passthrough-clean

Conversation

@chtangwin
Copy link
Copy Markdown

Summary

Forward --help and --version to external CLIs instead of handling them at the AutoCLI wrapper layer.

Problem

For external CLIs, commands like "--help", "--version" were intercepted by AutoCLI's wrapper parsing instead of reaching the underlying CLI directly.

$ gh --version
gh version 2.88.1 (2026-03-12)
https://github.com/cli/cli/releases/tag/v2.88.1

$ autocli --version
autocli 0.3.7

$ autocli gh --version
error: unexpected argument '--version' found

  tip: a similar argument exists: '--verbose'

Usage: autocli.exe gh --verbose

For more information, try '--help'.

$ gh --help
Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  auth:          Authenticate gh and git with GitHub
...

$ autocli gh --help
GitHub CLI — repos, PRs, issues, releases, gists

Usage: autocli.exe gh [OPTIONS] [COMMAND]

Options:
  -f, --format <format>  Output format: table, json, yaml, csv, md [default: table]
  -v, --verbose          Enable verbose output
  -h, --help             Print help

$ autocli --help
AI-driven CLI tool — turns websites into command-line interfaces

Usage: autocli.exe [OPTIONS] [COMMAND]

Commands:
  antigravity
  apple-podcasts
  arxiv
...

Changes

  • disable wrapper-level --help handling for external CLI subcommands
  • disable wrapper-level --version handling for external CLI subcommands
  • pass trailing args through directly to the external binary

Result

External CLIs now behave more like native commands and align better with user and agent expectations.

$ autocli --version
autocli 0.3.7

$ autocli gh --version
gh version 2.88.1 (2026-03-12)
https://github.com/cli/cli/releases/tag/v2.88.1

$ gh --version
gh version 2.88.1 (2026-03-12)
https://github.com/cli/cli/releases/tag/v2.88.1

$ autocli --help
AI-driven CLI tool — turns websites into command-line interfaces

Usage: autocli.exe [OPTIONS] [COMMAND]

Commands:
  antigravity
  apple-podcasts
  arxiv
...

$ autocli gh --help
Work seamlessly with GitHub from the command line.

USAGE
  gh <command> <subcommand> [flags]

CORE COMMANDS
  auth:          Authenticate gh and git with GitHub
...

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