Atlas CLI commands
Every built-in Atlas CLI command and flag, the API commands by resource, output formats, scripting and CI, exit codes, and what to do when a command fails.
Every Atlas API endpoint is a command. A few built-in commands handle sign-in, updates and completion.
Command pattern
- The resource is the area of the API, such as
campaign,call,agent,contact,phone-number,knowledge-base. - The operation is the action, such as
get-all-campaigns. - Arguments are the IDs in the path, in order.
- Flags are the query filters for that endpoint. You give each as
--name value.
Ask any command for its help:
The help for a command lists its arguments, filters and the body fields it accepts. For a machine-readable list of every command, flag, argument and exit code, run:
Built-in commands
Global flags
Every command accepts these.
Environment variables
API commands
The CLI builds these from the Atlas API definition, so the list grows when the API does. They are there whether or not you are signed in. The CLI downloads the definition on first run and keeps a copy for 24 hours. If a refresh fails, it keeps using the copy it has. To download it again now:
Run atlas <resource> --help for the full list in your version. These are the main commands. Arguments in angle brackets are IDs.
Jobs (the campaign resource)
The API and the CLI call a job a campaign. In the Atlas app it is a job inside a department. Command names keep the API word.
Calls
Statistics
Agents
Contacts
Knowledge base
Tools
Phone numbers
Voices
Webhooks (the events-gateway resource)
The signing-secret commands (events-get-webhook-signing-secret, events-rotate-webhook-signing-secret) are listed too, but their endpoints are not open yet. See Webhooks.
Other resources
The other resources are booking and business-verification. Every endpoint in the API reference has a command.
Send data
For commands that create or change something, give the body as JSON.
Inline:
From a file (JSON or YAML). Save this as subscribe.yaml:
Then:
Run <command> --help to see the body fields for any command and which are required.
If a field is a text field that holds JSON, you can give it as a normal object. The CLI turns it into text for you.
Commands that upload a raw file take --file <path> instead of a body.
Output
Output goes to stdout as JSON by default. Pick another format with --output (short: -o), or set output_format in ~/.atlas/config.
For list endpoints, the CLI prints the rows from value directly. You get an array, without the wrapper.
To see exactly what the CLI sends and receives, add --verbose (short: -v). The request and response show on stderr. The key is hidden.
Shell completion
The macOS and Linux installer and the PowerShell installer set up tab completion for you. Restart your terminal after installing. The Command Prompt installer does not. To set it up by hand:
Zsh. Add to ~/.zshrc:
Bash. Add to ~/.bashrc:
Fish:
PowerShell. Add to your PowerShell profile:
Exit codes
Every command exits with one of these codes. atlas help --json lists them under exit_codes.
Errors go to stderr. With the default JSON output, an error is one JSON object. status and body are there when the API answered:
With -o table or -o yaml, it is one line of text:
Scripting and CI
The CLI runs without a person at the keyboard.
What you can count on
- Results go to
stdoutas JSON. Errors go tostderr. - The exit code tells you the kind of failure. See Exit codes.
- A request waits up to 90 seconds for the API, then fails with exit code
5.
What to know before you automate
-
Set
ATLAS_API_KEYfrom your secret store. The CLI uses it directly, so you don’t needatlas loginand no key is written to disk: -
If you do use
atlas loginon a shared or temporary runner, the key is saved in~/.atlas/config. Remove it when the job ends withatlas logout. -
The automatic update check is skipped when
CIorATLAS_NO_UPDATEis1ortrue, whenstdoutis not a terminal (for example when you pipe the output), and with--no-update. For a pinned build, install a fixed version from the release folder. See Install by hand. -
List commands return one response. See Rate limits and pagination.
-
The API allows 100 requests a minute per key for each request method (
GET,POSTand so on). Add a pause in loops. A429exits with code4.
Example: nightly export of call records
--startDate and --endDate are filters from the call records endpoint. Run atlas call get-call-records --help to see every filter. The date -d form works on Linux. On macOS, use date -u -v-1d.
When something goes wrong
More on status codes in Errors.
Using the CLI from an AI agent
Agents can use the CLI. Read Atlas for AI agents first. It covers safe use.
