Documentation

cockpit accounts

Generated reference for cockpit accounts, including its syntax, options, results, and constraints from the canonical cockpit CLI source.

Applies to
CLI
WindowsmacOSLinux
FreeAGI Lab member

Verified 2026-12-01 · v5.2.2

Markdown

This reference is generated from the same canonical source distributed as cockpit CLI help. See Cockpit CLI for concepts and safe operating guidance.

Usage:

cockpit accounts [list] [--agent-type <type>]
cockpit accounts create <name> [--agent-type <type>]
cockpit accounts rename <name|id> <new-name> [--agent-type <type>]
cockpit accounts remove <name|id> [--agent-type <type>] --confirm
cockpit accounts login [<name|id|default>] [--agent-type <type>]
cockpit accounts logout <name|id|default> --agent-type antigravity [--confirm]
cockpit accounts auth <name|id> [--mode <claude-code|api-key|inherit>] [--stdin | --key-file <path> | --reset-key]

List, create, rename, remove, sign in to, and sign out of agent account profiles, and choose how a Claude profile authenticates. With no --agent-type, accounts and accounts list return every account for claude, codex, grok, antigravity, cursor, and qoder. Each entry includes its agentType. The default agent type for create, rename, remove, and login remains claude.

cockpit accounts
cockpit accounts list --agent-type claude
cockpit accounts --agent-type claude
cockpit accounts --agent-type codex
cockpit accounts --agent-type grok
cockpit accounts --agent-type antigravity
cockpit accounts --agent-type cursor
cockpit accounts --agent-type qoder
cockpit accounts create work --agent-type codex
cockpit accounts rename work "Work (EU)" --agent-type codex
cockpit accounts login work --agent-type codex
cockpit accounts remove work --agent-type codex --confirm
cockpit accounts logout work --agent-type antigravity
cockpit accounts logout default --agent-type antigravity --confirm
Option Description Default
--agent-type Agent type: claude, codex, grok, antigravity, cursor, or qoder All types for list; claude otherwise

In 5.2.1, additional Codex accounts use Codex's file credential store while their auth.json exists. Where the OS keyring is supported, Cockpit selects cli_auth_credentials_store="keyring" after that file is gone. On Linux without Secret Service or KWallet, accounts retain file storage; the default account follows its own configuration. Existing ChatGPT sign-ins in files remain usable and are not automatically migrated to the keyring. While such a file remains on a machine with a supported OS keyring, the account's entry in cockpit accounts list contains keyringMigrationPending: true, and Settings shows on its row that signing in again moves it to the OS keyring. Signing in again from that row, or through cockpit accounts login <name> --agent-type codex, signs the account out of both stores, saves the new sign-in in the keyring, and leaves no auth.json. The field is omitted for the default account, accounts already in the keyring, API-key accounts, and machines without a supported OS keyring. An API key in an additional account's auth.json moves to the keyring at startup through codex login --with-api-key on standard input. Removing an additional Codex account first clears and verifies keyring credentials where supported, then signs out the file store if present, so old credentials cannot take over. If sign-out cannot be confirmed, Cockpit keeps the account and its folder and removal fails. New visual sessions select a server matching the account's credential store; existing sessions keep their server. Additional Antigravity accounts on macOS keep their token in their own Keychain, whose password Cockpit keeps in the OS secure store; a password file an earlier version left beside that Keychain is removed once the secure store holds that same password, and nothing is created or changed while the secure store cannot be read. An earlier version of Cockpit looks for the password only in that file, so it makes a new password that does not match the Keychain, and signing in again does not fix that: after going back, remove the account and add it again. After coming back to this version, Cockpit keeps using the password in the secure store and leaves such a file in place. See cockpit help secret for the other agents.

Codex accounts use isolated configuration copies. New accounts do not inherit model_catalog_json, just as they do not inherit provider or connection overrides. When provisioning an existing account, Cockpit removes absolute catalog overrides pointing into the default Codex home from its config.toml, including named TOML profiles. These shared-home references can freeze the model list at an old snapshot. The original configuration is preserved beside it as config.toml.before-model-catalog-migration, without overwriting an earlier backup. The default account's configuration, credentials, relative catalog paths, and catalogs outside the shared home are unchanged. Existing sessions keep their loaded configuration until reconnected; a newly started session uses the migrated configuration.

When listing all types, each entry contains agentType. Every entry also contains profileId (null for the default account), name, emailAddress when available, authState, loggedIn, provider-specific usage, usageState, and usageFetchedAt. A Codex entry's usage.credits is its purchased credit balance, and a Claude entry's usage.limitResetsAvailable and usage.limitResets are its unused limit resets. A Claude entry's usage.extraUsage is this month's extra-usage spend and monthly limit. A Claude entry has no usage.fiveHour when the account's plan has no five-hour window, and auto selection then measures its remaining usage with the windows it has. Each of these has the same shape and omission rules as in cockpit usage. Grok Build and Claude entries also contain authReason, described below. Accounts whose usage state is auth_required or configuration_required remain in the response with those states intact; treat them as unusable. Cursor is the exception for auth_required: its usage is requested with the Cursor CLI's own saved sign-in, but a rejected usage request alone never blocks the account. A Cursor account in that state keeps authState: "ok" while its CLI credential is present and in date, and stays usable; the Usage screen offers to sign in again with the Cursor CLI. A usage reading that simply could not be obtained is reported as unknown — the fetch timed out, the network was down, or the failure could not be classified — and error means the same thing for providers that still report it. Neither is an authentication verdict: such an account keeps authState: "ok" and loggedIn: true when its credential is present, stays usable, and is still chosen by auto selection (ranked below accounts with a known remaining quota).

authState is the authentication verdict for the account: ok (a credential exists and passed the provider's authentication check), expired (a credential exists but no longer works — its stored expiry has passed without a refresh token, or the usage fetch failed because of authentication and the usage state is auth_required), or signed_out (no credential is stored). loggedIn remains for compatibility and is true only when authState is ok, so an expired account is reported as loggedIn: false. The check is lightweight: Claude reads the expiry and the refresh token of its stored OAuth credential (see the Claude authReason table below), Codex reads the expiry of its stored token and, when the usage API rejects the token, asks the Codex CLI to refresh it before reporting expired, Cursor reads the expiry of its stored token and reports expired when no token can be found for a signed-in identity, never because its usage API rejected the request, Grok Build reads the expiry and the refresh token of its stored credential (see authReason below), Antigravity checks credential presence without reading its contents and lets the official CLI authenticate; only a CLI authentication rejection reports expired, and Qoder relies on the CLI's logged_in status. A usage fetch that the provider rejected because of authentication (for Grok Build, a gRPC UNAUTHENTICATED status or an HTTP 401/403) stays expired even while an older cached usage snapshot is still served, and the rejection is remembered across later transient failures until a usage fetch succeeds again. Completing a sign-in from the Accounts settings or cockpit accounts login clears the cached verdict for that agent, so the next cockpit accounts list re-checks immediately instead of waiting for the usage cache to expire. A sign-in completed outside Cockpit (for example claude login in a terminal) is picked up by the next authentication status check in the app: when the CLI reports a signed-in account that Cockpit still remembers as expired, Cockpit re-runs the full check before answering. A status check that opening Settings or the first-run guide starts on its own re-runs it at most once a minute; the refresh button in Settings and the retry on a task screen re-run it every time. It waits at most 10 seconds for that check; after that it answers with the remembered verdict and the check finishes in the background, and the Settings sign-in button stays available while a check runs. Auto account selection and the Fleet pre-run account check skip every account whose authState is not ok; sign in again with cockpit accounts login to recover an expired account. An unreadable usage reading never produces that verdict: authState is derived from the credential itself plus an explicit authentication rejection, so a unknown or error usage state leaves authState: "ok" and the account selectable.

When an account's authState becomes expired, or a task cannot be created because no account of that agent is signed in (no_signed_in_account, except a Claude account that uses an Anthropic API key and has no saved key), Cockpit tells the user once per account with an OS notification and a notice in the window that opens that agent's settings; repeated failures on the same account do not add more. After signing in again, continue a task that stopped on the expired sign-in with cockpit task reconnect <id>.

Grok Build access tokens last about six hours and the Grok Build CLI renews them with the stored refresh token the next time it runs, so an expired Grok Build access token alone is not a sign-out. One shared decision feeds the accounts list, auto account selection, the Fleet pre-run account check, the Settings sign-in status, the Grok Build usage reader, and the task start, and each Grok Build entry reports it as authReason:

authReason authState Meaning
valid ok The stored access token has not expired
expired_refreshable ok The access token expired but a refresh token is stored; the Grok Build CLI renews it on its next run. The account stays selectable. Usage cannot be read with the expired token, so usageState is unknown (or stale while an older reading is served) until the renewal
network_failure ok The last renewal attempt failed because of the network. This is not an authentication verdict; the account stays selectable
refresh_refused expired The provider refused the refresh token (for example invalid_grant) the last time a task signed in. Manual sign-in is required. The verdict is dropped as soon as the credential file is rewritten
expired_without_refresh expired The access token expired and no refresh token is stored. Manual sign-in is required
provider_rejected expired The stored credential looks usable but the usage API rejected it as unauthenticated
missing_file signed_out The account has no auth.json
unreadable_file signed_out auth.json exists but cannot be read or parsed
no_credential signed_out auth.json holds no access or refresh token

The Fleet pre-run account check names the same reason when it rejects a fixed Grok Build account, for example authentication expired: refresh refused.

Claude Code renews an expired access token with its stored refresh token the next time it runs, so an expired Claude access token alone is not a sign-out either. Cockpit reads the stored credential from the macOS Keychain or from .credentials.json in the account's configuration directory and never renews or rewrites it. The same decision feeds the accounts list, auto account selection, the Fleet pre-run account check, task creation, the Settings sign-in status, and the account menus, and each Claude entry reports it as authReason:

authReason authState Meaning
valid ok The stored access token has not expired
expired_refreshable ok The access token expired but a refresh token is stored; Claude Code renews it on its next run. The account stays selectable. Usage cannot be read with the expired token, so usageState is unknown (or stale while an older reading is served) until the renewal
unreadable_credential ok The Keychain item or credential file exists but could not be read (for example the Keychain was locked or did not answer in time). This is not an authentication verdict; the account stays selectable
refresh_refused expired The access token expired and Claude Code asked to sign in again when Cockpit ran it to read usage. Manual sign-in is required
provider_rejected expired The stored access token has not expired but the usage API rejected it as unauthenticated
expired_without_refresh expired The access token expired and no refresh token is stored. Manual sign-in is required
no_credential expired or signed_out No Keychain item and no credential file hold a token. The account is expired while Claude Code still records a signed-in identity for it and its usage cannot be read, and signed_out when no identity is recorded

The Fleet pre-run account check names the Claude reason the same way, for example authentication expired: provider rejected. A rejection is tied to the access token it was observed with and keeps the reason recorded at that moment, so a rejected token that later expires is still reported as provider_rejected. Once Claude Code stores a different token, the next check starts fresh instead of carrying the old verdict, including a check answered from the usage cache. A Keychain that cannot be read for a moment keeps the verdict.

create creates an isolated profile and returns it. rename changes only the display name of an existing profile, selected by its current name or its profileId, and returns the renamed account. It never changes the profile id, its stored credentials, or any task's or Autorun's account assignment, and it never requires signing in again. Renaming is allowed while a task or Autorun uses the profile, because those reference the profile by id and only the label changes; the new name appears in the account switcher, Usage, and Settings immediately and after a restart. Fleet YAML is the exception: a node's account: <name> is resolved by name at run time, so after renaming a profile that a fleet targets, update that fleet's account values — otherwise the next cockpit fleet run fails its pre-run account check with account "<old name>" was not found. The default account has no stored profile name, so cockpit accounts rename default ... is rejected with 400. A name is required and is trimmed; a blank or whitespace-only name, a name longer than 40 characters, a name containing control characters, a name already used by another profile of the same agent type, and a name reserved for account selection (default, auto, an existing profile id, or any name starting with profile-, all case-insensitive) are rejected with 400 — the same rules create applies, so profile names stay unambiguous for --account <name> selectors. login opens Settings → Agents in the target Cockpit and starts that provider's existing interactive authentication flow; the command returns after the navigation is sent or queued, not after authentication completes. Omit the account selector to sign in to the default account. remove deletes only named profiles, never the default account, and requires --confirm. Removal is rejected while a task or Autorun uses the profile.

All commands also accept the task transport options --host, --port, and --https to operate another Cockpit. A remote login opens the authentication flow on that remote Cockpit.

Assign a task or Autorun to an account with --account <auto|name|id|default>. Providers with Auto selection default to auto, which selects the signed-in account whose longest usage window, such as a weekly limit, leaves the most remaining usage per minute until it resets, and switches accounts after a usage limit. Each Autorun execution resolves Auto again, so recurring runs are not pinned to the account selected for an earlier run. Antigravity always uses a fixed account; omitted or legacy auto selectors bind to the default account without rotation. --claude-profile and --codex-profile remain compatibility aliases.

cockpit task run --instruction "Instruction text" --directory /path/to/repo --agent-type grok --account work
cockpit autorun create --name "Daily review" --instruction "Review changes" --directory /path/to/repo --agent-type cursor --account work --type cron --expression "0 9 * * *"

Switch a running task to another account with cockpit task account <id> <name|id|default> (see cockpit help task).

Claude authentication per profile

cockpit accounts auth chooses how one named Claude profile authenticates in the Visual UI and stores that profile's own Anthropic API key. It applies only to named Claude profiles (--agent-type claude, the default); other agent types and default are rejected before anything is sent. The default account keeps using agents.claudeVisualAuthMode and agents.credential.anthropic (see cockpit help settings).

cockpit accounts auth work
cockpit accounts auth work --mode api-key --key-file /path/to/protected-key
op read "op://vault/anthropic/key" | cockpit accounts auth work --stdin
cockpit accounts auth work --mode claude-code
cockpit accounts auth work --reset-key
cockpit accounts auth work --mode inherit
Option Description
--mode One of the two methods Settings offers. claude-code: always use this profile's Claude Code login, even while agents.claudeVisualAuthMode is api-key. api-key: use only this profile's own key, with this profile's configuration directory and session history. inherit is not a third method: it is the unset state every profile starts in, kept for compatibility, where the profile follows agents.claudeVisualAuthMode. With claude-code the profile then uses its own Claude Code login; with api-key the task runs as the default account with the shared agents.credential.anthropic key, exactly as before profiles had their own method. Settings shows an unset profile with the method it follows already selected and saves nothing until a different method is chosen there
--stdin / --key-file Save this profile's Anthropic API key from standard input or a protected file. Input is trimmed and must contain 1–65536 characters
--reset-key Remove only this profile's key

Without options the command only reads. The response is {"account": {...}} with profileId, name, loggedIn, authMode, and apiKeySet; it never contains the key. --mode can be combined with one key option; the key is written first, and the mode changes only after the key write succeeds. Give the key only through --stdin or --key-file: positional values, --key=..., and other inline forms are rejected before anything is sent, without repeating their contents, and the key is not passed to any command line. Input errors are the same as for cockpit settings set agents.credential.<name> (no input on standard input, a missing, unreadable, or empty key file, or a key longer than 65536 characters) and never print the file path or the key. Keys are kept in the same encrypted storage as agents.credential.*, in a separate entry per profile id; settings reads and the shared credential keys never show or replace them. Renaming a profile keeps its key and method; removing a profile removes only its own key. auth changes keys only on the local Cockpit; with --host it is rejected with 404.

Each named Claude entry in cockpit accounts list also contains authMode (claude-code or api-key when the profile has its own method, inherit when it has none and follows agents.claudeVisualAuthMode, which cockpit settings get agents.claudeVisualAuthMode reads, or invalid when the stored value is not recognized) and apiKeySet. apiKeySet reports only that a key is stored; Cockpit never checks whether the key works. loggedIn, authState, and authReason keep describing the profile's Claude Code login, which the Terminal UI keeps using. Settings shows an api-key profile with its key state (Anthropic API key when apiKeySet is true, API key not set otherwise) in place of its Claude Code login and sign-in button; claude-code, inherit, and invalid profiles keep showing their Claude Code login. Cockpit reads no subscription usage for an api-key profile (its usage is null and usageState is unknown, and it is left out of cockpit usage), and it reads no API usage or cost; its Visual tasks are billed to its key.

Rules for Visual tasks, Crews, Autoruns, Fleets, and model lists:

  • An api-key profile is used only when chosen explicitly (--account <name|id>). Auto selection, usage-limit account recovery, a child task inheriting an Auto account, and an Autorun or Fleet Auto choice never pick it, and a failure on it never moves the task to another account or to the subscription. An existing Auto task whose profile was changed to api-key stops with an error when it next starts, reconnects, or retries, and its model list shows the built-in list instead of starting Claude Code; choose the profile explicitly or another account to continue.
  • A fixed api-key profile is usable when apiKeySet is true, whatever the state of its Claude Code login; the Fleet pre-run check, task creation, and account switching report it as unusable otherwise, and the task does not start. It never falls back to the shared key or another profile's key, including when its own key cannot be read.
  • An invalid method, or a profile removed after it was chosen, stops the task instead of guessing a billing method.
  • Changes take effect when a task next starts or resumes. Running sessions keep their current sign-in, and switching a profile's method never signs it out of Claude Code.
  • The Terminal UI ignores the method and keeps using the profile's Claude Code login and configuration directory, including for Auto selection and usage-limit recovery; such a profile ranks as an account with unknown usage there.

Antigravity account isolation

Antigravity sign-in runs the official agy acp --login in a terminal. Agy owns Google sign-in and credential storage. Cockpit never reads, refreshes, copies, or reinjects Antigravity credential contents. All Agy child processes have AGY_CLI_DISABLE_AUTO_UPDATE=1.

Additional Antigravity profiles are supported only on macOS. Their HOME, USERPROFILE, and JETSKI_APP_DATA_DIR point to the selected profile. Cockpit creates and unlocks a profile Keychain, places it first in that profile's search list, and seeds only a noncredential placeholder. It refuses to launch when that isolation cannot be established. Credential presence uses file size or Keychain item metadata, not the stored value; it cannot prove the login is valid. The host Keychain remains available afterward for developer tools. Noncredential settings and shell resources remain shared. Actual additional-profile login and persistence after reboot have not been verified with the official ACP CLI.

Windows and Linux use a shared OS keyring, so Cockpit supports only the default Antigravity account there. Existing additional profiles remain listed and can be renamed or removed; their login and execution are unavailable. Changing HOME does not establish credential isolation on those systems. Native Windows/Linux ACP operation remains unverified.

Existing profiles are never removed or signed out automatically. Profiles with old Cockpit sign-in files show a sign-in-again notice. On macOS, explicitly run cockpit accounts logout <profile> --agent-type antigravity to review the targets, repeat with --confirm, then run cockpit accounts login <profile> --agent-type antigravity. The default account needs no migration. Revoking Google's permission for the shared CLI client can also invalidate the default CLI login.

A profile Keychain item without a valid Cockpit placeholder fingerprint is unconfirmed: its metadata alone cannot distinguish an old signed-out placeholder from a login. Cockpit keeps the item and does not use it as evidence of sign-in. Use the explicit profile logout and sign-in procedure above to establish a fresh placeholder baseline before Agy signs in. Credential contents are not inspected.

Explicit confirmed profile logout also resets an existing unconfirmed or signed-out profile item. The preview includes that profile Keychain target even when sign-in cannot be confirmed. Cancelling at the preview writes nothing, and the host item is never added to a profile's removal targets.

Additional accounts are selected manually. Antigravity has no Auto account selection or usage-limit account recovery: legacy auto selectors resolve to the fixed default account.

Each Antigravity entry includes isolation with credentialSource, credentialHome, quotaSource, quotaScope, and sharedState. quotaScope describes the configured storage boundary, not proof of a separate login. Usage comes only from agy -p "/usage" --output-format json when the Usage panel opens. Account lists and CLI usage reads return cached or unknown data and launch no usage process. Unreadable or unsupported output stays unknown; there is no private API, language-server, or history fallback.

logout is the Cockpit equivalent of Agy's /logout. Without --confirm it only reports the exact targets it would clear (targets, each with kind, path, and shared) and changes nothing. With --confirm it clears them and reports cleared and failed. Target kinds:

kind path Cleared by
host_keychain_item The Keychain file that holds the login item gemini/antigravity, resolved with security find-generic-password (normally ~/Library/Keychains/login.keychain-db) security delete-generic-password pinned to that Keychain file
host_keyring_item Windows: Credential Manager entries gemini:antigravity (written by Agy) and gemini/antigravity; Linux: Secret Service items service=gemini username=antigravity and gemini/antigravity cmdkey /delete or secret-tool clear, plus keytar
profile_keychain_item The profile Keychain file Replacing the item with the placeholder
file Token files under the account home (antigravity-oauth-token, jetski-standalone-oauth-token, oauth_token, google_accounts.json) Deleting the file
gemini_cli_file <home>/.gemini/oauth_creds.json, the Gemini CLI credential; it is not an Antigravity sign-in indicator, but explicit logout lists it separately because clearing it also signs Gemini CLI out of that home Deleting the file

For the default account the targets are the host item plus the files under ~/.gemini; every other profile, and Agy started from a terminal without a profile, that relied on that host login is signed out too. For a profile the targets are the profile Keychain item and the files under that profile's home only; the host login is never touched. When a profile's effective credential is the shared host login (Windows, Linux, or a macOS profile whose Keychain is not ready or not first in its search list), the report sets sharedCredential to that host item and the message points to cockpit accounts logout default --agent-type antigravity --confirm. Cockpit never runs logout automatically. Manual equivalent: open a terminal with the same HOME, run agy, and enter /logout, then sign in again with cockpit accounts login <account> --agent-type antigravity.

When Cockpit reports an Antigravity quota as exhausted, the usage message names the home and credential source the quota was measured for and points to this recovery procedure.