You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI had no way to see what it was doing on the wire: library loggers
were actively silenced so stderr stayed clean next to normalized errors,
and diagnosing an auth or connectivity problem meant reading code.
A new root flag closes that gap (counted, gh/speechmatics style):
- `-v` surfaces request-level logs (httpx and friends at INFO)
- `-vv` adds wire-level detail (websockets frames, httpcore events at DEBUG)
aai_cli/debuglog.py installs one stderr handler with a redacting
formatter; config.resolve_api_key and AppState.resolve_session register
the API key and session JWT at their resolution choke points so verbose
output can never print them in clear (websockets logs the raw
Authorization header at DEBUG during the handshake). The realtime
silencers (aai_cli.ws, streaming/diagnostics) stand down while verbose
mode is active, and the root callback logs the resolved environment.
https://claude.ai/code/session_01Q6KZYc7FPWhyJkbQLUtq36
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,7 @@ Each file in `aai_cli/commands/` is a Typer sub-app (`transcribe`, `stream`, `ag
173
173
-**`environments.py`** — a frozen `Environment` (api_base, streaming_host, llm_gateway_base, ams_base, stytch_*). `DEFAULT_ENV` is **`production`**; use `--sandbox` (or `--env sandbox000` / `AAI_ENV`) to target the sandbox. The active environment is a process-global set once at startup; precedence: `--env` → `AAI_ENV` → profile's stored env → default. A credential is only valid against the environment that minted it.
174
174
-**`client.py`** — thin wrappers over the `assemblyai` SDK (`transcribe`, `list_transcripts`, `stream_audio`, etc.). It normalizes SDK exceptions: auth failures become a single clean `auth_failure()``CLIError`; everything else becomes `APIError`. New SDK calls should follow this try/except shape.
175
175
-**`errors.py`** — the `CLIError` hierarchy (each with `error_type` + `exit_code`). `output.py` emits errors to **stderr**; stdout stays clean for pipelines. `--json` switches to machine-readable output; it is never auto-enabled — `output.resolve_json()` deliberately keeps human text the default even when piped or agent-run.
176
+
-**`debuglog.py`** — the root `-v/--verbose` flag (count: `-v` request-level at INFO, `-vv` wire-level at DEBUG). The CLI normally configures no logging, and the realtime paths *silence* library loggers (`ws.py`, `streaming/diagnostics.py`); verbose mode installs one redacting stderr handler and those silencers stand down. Secrets are registered at their resolution choke points (`config.resolve_api_key`, `AppState.resolve_session`) and masked in every rendered record — websockets logs the raw Authorization header at DEBUG, so masking lives in the formatter, not at call sites. Stdlib-only on purpose: `config` (a Rich-free layer) imports it.
0 commit comments