Skip to content

Make CLI output idioms match the tools agents see most#37

Merged
alexkroman merged 4 commits into
mainfrom
claude/cli-idioms-ai-agents-PcPd5
Jun 8, 2026
Merged

Make CLI output idioms match the tools agents see most#37
alexkroman merged 4 commits into
mainfrom
claude/cli-idioms-ai-agents-PcPd5

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Aligns the CLI with the reflexes drilled from gh/docker/kubectl/aws, and
makes human-readable text the default everywhere instead of auto-switching
to JSON when piped or under CI/an agent.

  • Default to human output; JSON is opt-in via --json (or -o json where it
    applied). resolve_json no longer flips on a non-TTY or CI/CLAUDECODE env,
    so aai transcribe x | grep word keeps getting the transcript, not JSON.
    Being off a TTY still drops color and syntax highlighting.
  • Add root aai --version / -V (eager) alongside the version subcommand.
  • Reconcile --json vs -o: -o/--output is now a plain-text field projection
    only (text, id, status, utterances, srt; text for llm/stream/agent); full
    JSON / NDJSON lives on --json. Drops the confusing -o json overlap.
  • Ship shell completion (add_completion=True): --show/--install-completion.
  • Add a global --quiet/-q to suppress non-essential stderr (warnings, hints).
  • Give NotAuthenticated its own exit code 4 (was 2), so scripts can tell
    "not signed in" apart from a usage error; UsageError keeps 2.
  • Update help text, snapshots, README, and tests to match.

https://claude.ai/code/session_01MyytEHLdk3mWdAY3p16cwX

claude and others added 4 commits June 7, 2026 23:56
Aligns the CLI with the reflexes drilled from gh/docker/kubectl/aws, and
makes human-readable text the default everywhere instead of auto-switching
to JSON when piped or under CI/an agent.

- Default to human output; JSON is opt-in via --json (or -o json where it
  applied). resolve_json no longer flips on a non-TTY or CI/CLAUDECODE env,
  so `aai transcribe x | grep word` keeps getting the transcript, not JSON.
  Being off a TTY still drops color and syntax highlighting.
- Add root `aai --version` / `-V` (eager) alongside the `version` subcommand.
- Reconcile --json vs -o: -o/--output is now a plain-text field projection
  only (text, id, status, utterances, srt; text for llm/stream/agent); full
  JSON / NDJSON lives on --json. Drops the confusing -o json overlap.
- Ship shell completion (add_completion=True): --show/--install-completion.
- Add a global --quiet/-q to suppress non-essential stderr (warnings, hints).
- Give NotAuthenticated its own exit code 4 (was 2), so scripts can tell
  "not signed in" apart from a usage error; UsageError keeps 2.
- Update help text, snapshots, README, and tests to match.

https://claude.ai/code/session_01MyytEHLdk3mWdAY3p16cwX
…agents-PcPd5

# Conflicts:
#	aai_cli/client.py
#	aai_cli/commands/agent.py
#	aai_cli/commands/llm.py
#	aai_cli/commands/stream.py
#	aai_cli/commands/transcribe.py
#	aai_cli/commands/transcripts.py
#	aai_cli/main.py
#	aai_cli/output.py
#	tests/__snapshots__/test_cli_output_snapshots.ambr
#	tests/test_smoke.py
PR #38 split the setup tests into test_setup.py and test_setup_install.py
(sharing tests/setup_helpers.py). The `_force_json` autouse fixture this
branch added — needed because output is now human-by-default — only lived
in test_setup.py, so the install/status tests that moved to the new file
parsed human text as JSON and failed (14 JSONDecodeError failures in CI).
Add the same fixture to test_setup_install.py.

https://claude.ai/code/session_01MyytEHLdk3mWdAY3p16cwX
@alexkroman alexkroman merged commit 94cbffb into main Jun 8, 2026
10 checks passed
@alexkroman alexkroman deleted the claude/cli-idioms-ai-agents-PcPd5 branch June 8, 2026 01:40
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.

2 participants