Which credentials the CLI uses
In order:- The
ARDENT_TOKENenvironment variable, if set. - Otherwise, the login stored on this machine from
ardent login.
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:
- 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:
All error codes
All error codes
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:Polling environment variables
Polling environment variables
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.