The CLI is agent-first: the default output is structured JSON — no spinners, no color codes, no decorations. Just parseable data on stdout. Progress, warnings, and errors go to stderr so piping always works cleanly. Humans can opt into a prettier experience withDocumentation Index
Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
--human.
Default: JSON (Agent-Friendly)
Every command outputs clean JSON by default. The response follows the HeyGen API envelope shape — a top-leveldata field wraps the payload:
--human: Pretty Output for Humans
Add --human when you’re working interactively. You get tables, colorized status values, and human-readable timestamps:
get commands (single resource), --human renders a key-value layout:
--wait is used in human mode, the CLI shows a live spinner on stderr while polling:
--human), the spinner falls back to plain-text status lines:
Errors
Errors always go to stderr as a structured JSON envelope, regardless of output mode:--human mode, errors render as readable text instead:
request_id field is included when the error comes from the API (from the X-Request-ID response header). It is omitted for local errors such as bad flags or missing credentials.
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error (API error, network failure) |
2 | Usage error (invalid flags, missing arguments) |
3 | Authentication error (missing or invalid API key) |
4 | Timeout (resource created but polling timed out) |
4 is distinct from 1 so agents and scripts can tell “the resource was created but we don’t know the final status” apart from a hard failure. Stdout will contain the last known resource state when exit 4 occurs.
Configuring a Default Output Mode
Set a persistent default so you don’t need--human on every command:
json (default) and human. The priority order is:
--human flag → HEYGEN_OUTPUT env var → config set output → default (json)
Stdout vs Stderr
The CLI strictly separates data from everything else:- stdout — JSON payload only. This is what gets piped to
jq, captured in shell variables, or consumed by agents. - stderr — progress indicators, warnings, and error messages.

