json, table, or csv. The CLI picks the right one automatically based on where the output is going, and you can override it on any command.
Auto-detection
| Where output goes | Default format |
|---|---|
| A terminal (TTY) | table |
| A pipe or redirect | json |
stdout at startup. Running interactively gets a human-friendly table. Piping to another tool or redirecting to a file gets parseable JSON. That means talkvalue path person list | jq works with no flag required.
Override the format
Pick a format explicitly with--format:
--json shorthand:
--json flag is equivalent to --format json and exists because it’s the most common override.
JSON envelope
Every JSON response wraps the result in a stable envelope so scripts can rely on the shape. Single-resource response:pagination block is present on every list command and lets you compute the next page or total count without a second request.
Error envelope
Errors go to stderr, not stdout, and use a separate envelope:CSV
--format csv works on any list command and writes RFC-4180 compliant CSV with the first row as headers. Use it for spreadsheets or ad-hoc reports:
person export, event person export, channel export, import failed-export) always emit CSV regardless of --format. They exist specifically for spreadsheet workflows.
TTY tips
- Color. Table output uses color when stdout is a TTY. Turn it off with
--no-colororNO_COLOR=1, or force it withFORCE_COLOR=1in places like CI logs that strip TTY detection but render ANSI. - Update banner. The CLI prints an upgrade banner when a newer version is on npm. It’s automatically suppressed when output is JSON or piped, so it never contaminates parsed output.
Related
- Exit codes. Branch on success vs auth error vs not-found in scripts.
- Global flags.
--format,--json,--no-color, and the rest. - Scripting with jq. Common
jqpatterns for CLI output. - Environment variables.
NO_COLOR,FORCE_COLOR.
