Make CLI output idioms match the tools agents see most#37
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
applied). resolve_json no longer flips on a non-TTY or CI/CLAUDECODE env,
so
aai transcribe x | grep wordkeeps getting the transcript, not JSON.Being off a TTY still drops color and syntax highlighting.
aai --version/-V(eager) alongside theversionsubcommand.only (text, id, status, utterances, srt; text for llm/stream/agent); full
JSON / NDJSON lives on --json. Drops the confusing -o json overlap.
"not signed in" apart from a usage error; UsageError keeps 2.
https://claude.ai/code/session_01MyytEHLdk3mWdAY3p16cwX