Last updated: 2026-09-06The CLI authenticates with a tenant API key (an
ao_ token, see API keys). The tenant and role come from the key; there is no separate tenant flag. orca login mints a key for you through the dashboard and stores it locally. In CI you skip the login and supply a key through the environment.
Signing in
orca login and orca auth login are the same command. It picks one of three flows:
- Browser (default)
- Device code
- Token
In an interactive terminal on a machine with a browser, the CLI binds a loopback port on
127.0.0.1, opens https://app.orcapods.ai/cli-auth with a one-time state value, and waits for the dashboard to post the minted key back. Sign in, confirm the request, and the key lands in the CLI without ever appearing on screen.If the callback does not arrive within five minutes, the CLI falls back to a masked paste prompt so you can copy the key from the dashboard by hand. Ctrl-C exits with code 130.
The minted key inherits the role of the user who approved it. The approval screen shows the key label, so you can see which terminal or agent asked.
Checking who you are
whoami asks the server which tenant, role, and key the stored credential resolves to. auth status shows the local view: the active context, its URLs, and a masked key, and verifies the key against the API. doctor runs a full set of connectivity and configuration checks and prints a fix for each problem it finds.
Where credentials live
Credentials and contexts are stored in one JSON file:0700 and the file with 0600; the CLI re-applies 0600 on every save and warns on load if the file is readable by other users. The location follows ORCA_CONFIG_DIR if set, otherwise $XDG_CONFIG_HOME/orca, otherwise ~/.config/orca.
keyId is the server-side id of the minted key, recorded so orca auth logout --revoke can revoke it. It is absent when the key was pasted or passed with --with-token.
Contexts
Contexts work likekubectl contexts: each holds a key and the URLs for one tenant or one deployment, and one of them is current. Use them to switch between organizations, or between the hosted platform and a self-hosted conductor.
orca login writes into the context named by --context (or ORCA_CONTEXT), creating it if needed, and makes it current. context use switches the current context; context show prints the effective configuration after environment overrides, marking values that came from baked-in defaults. For one command at a time, pass --context <name> or set ORCA_CONTEXT.
Precedence
Every setting resolves in the same order, per field:- A command-line flag (
--api-url,--context) - An environment variable
- The current context in the config file
- The baked-in production default
Contexts that predate
cli-v0.5.0 may hold the old raw Railway hostname as apiUrl. The CLI transparently treats that exact value as https://api.orcapods.ai and rewrites it on the next login; custom URLs are never touched.
CI and other headless environments
No config file is needed. Set the key in the environment and every command works:ORCA_API_URL is only required for self-hosted or local conductors. When both ORCA_API_KEY and ORCA_API_URL are set, a --context name that does not exist in the config file is accepted rather than rejected, so the same script runs on a developer machine and in CI.
Mint a key for a pipeline from a machine that is already signed in:
CI_KEY=$(orca keys create ci-deploy) captures it cleanly. See the orca keys reference.
Signing out
--revoke asks for confirmation in a terminal; add --yes to skip the prompt in scripts. If the server-side revoke fails, the CLI warns and still clears the key locally.
Errors on a missing or rejected credential are consistent: no key configured exits 3 with the hint Run: orca auth login or Or set ORCA_API_KEY; a 401 or 403 from the API also exits 3. See exit codes.
For the agent-oriented summary of these flows, see Headless authentication.