Skip to main content
Everything on this page is optional. The defaults work for everyday use — come here when you’re wiring the CLI into a script, CI job, or agent.

Which credentials the CLI uses

In order:
  1. The ARDENT_TOKEN environment variable, if set.
  2. Otherwise, the login stored on this machine from ardent login.
The environment variable always wins. In CI, just set ARDENT_TOKEN — you don’t need to log out first or clean up old logins. The API endpoint works the same way: ARDENT_API_URL wins if set, then any stored value, then the default https://api.tryardent.com.

Where the CLI keeps its state

One file: ~/.ardent/config.json. It holds your token, API URL, current selections, and a cache for offline use. ardent logout deletes this file. It does not revoke API tokens — do that in the dashboard under Settings > API keys.

Exit codes

JSON output

branch create and branch info accept --format json:
Three rules keep your scripts stable:
  • Read the fields you need; ignore the rest. New fields may be added.
  • Fields that don’t apply are null, never missing.
  • Errors are JSON too, with a stable code:
Flag mistakes — an unknown --format value, two flags that can’t be combined — print a plain-text error and exit 2. They are never wrapped in JSON, because they happen before JSON mode starts.
--print-url is the simpler option when you only want the URL: it prints one line and nothing else. You can’t combine it with --format.

Timeouts and polling

Branch creates and deletes run on Ardent’s servers; the CLI waits and checks progress. By default it waits up to 65 minutes for a create and 10 minutes for a delete. If the CLI stops waiting, the work usually finishes server-side anyway — the Branches page covers what to do. Most CI jobs never need to change this. If yours does:
Always use positive whole numbers. Zero, negative, and non-numeric values are either rejected or fall back to defaults — and a zero or negative interval can hammer the API in a tight loop.