Skip to main content
The CLI uses the same Cortex account as the web app. Sign in once per machine; the session is stored in your operating system’s keyring.

Browser sign-in (default)

Cortex prints a verification URL and opens it in your browser. Approve the sign-in there and the CLI picks up the session. From inside the TUI, /login does the same without leaving your session; the inline screen offers Continue with browser or Paste an API key.
Welcome to Cortex CLI — How would you like to log in? Continue with browser or Paste an API key

The inline sign-in picker: Continue with browser, or Paste an API key. Numbered rows, arrow keys to select, Enter to confirm.

A machine without a browser

Cortex prints a short code and a URL. Open the URL on any device that has a browser, enter the code, and the CLI continues when the sign-in is approved. Good for servers, containers, and remote shells.
Waiting for browser authentication with a device code shown

Waiting for the browser: the code to enter, and the URL to visit if the browser did not open. Esc cancels.

Unattended use: API key or token

For CI and other unattended runs, do not use the browser flow.
Or skip cortex login entirely and set the variable for the job: Take the value from your CI secret store. Never write it into a workflow file or commit it.

Enterprise SSO

cortex login --sso is available for organisations that sign in through single sign-on. The web app’s sign-in dialog offers the same Single sign-on (SSO) route.

Check and sign out

In the TUI: /account (aliases /whoami, /me), /login, /logout.

Where credentials are stored

Credentials are deliberately not written to a plaintext file in your home directory, and never into the repository. If no keyring is available — a bare container, a headless CI runner — use CORTEX_API_KEY or CORTEX_AUTH_TOKEN instead of trying to make one work.

Troubleshooting