Skip to content

CLI Configuration ​

The permission mode and local tool availability have separate scopes. See permissions before changing the permission mode.

Local configuration ​

The CLI can retain local preferences, a selected workspace, and saved credentials in its user-scoped configuration. Use a private location you control; do not commit, share, or include its contents in support reports.

Treat any locally retained token as a secret. If you prefer not to keep credentials on a machine, use an explicit environment variable or supported non-interactive input instead.

Interactive settings ​

In the interactive conversation, /settings (also /config) lists your preferences, including:

  • Permission mode: see permissions.
  • Show suggestions: off by default. When on, follow-up suggestions sit above the message box after an answer.
  • Language: the language Chainabit uses for you on every device: English, Türkçe, Español, Français, Deutsch, Português or العربية. The CLI starts in your account language and changes at once when you change it here. Only the CLI's own text is translated; model output, your content, command names and paths are not.

Account defaults ​

Your account can hold defaults for the CLI on every device you sign in on: the permission mode for new conversations, the model, reasoning, conversation sync and the terminal preferences above. Set them at https://chainabit.com/dev/cli; each CLI reads them when it starts.

In /settings every value shows where it comes from: Set here (you chose it on this device), Account (the account default), Last used, Default or Organization. A value you set here wins. Follow account default drops your own value so the account default applies again. A default that would loosen this device, such as Auto approve, waits for your answer in /permissions; see Account defaults. chainabit doctor reports whether account defaults are cached and how many wait for you.

Two ways to sign in ​

The CLI keeps two independent sign-ins, and one of them is in use at a time:

  • Subscription: chainabit auth login, in the browser or with the device flow. It is the sign-in for interactive conversations.
  • Chainabit API key: chainabit auth login --api-key asks for the key without showing it, or reads it from stdin. --token-env, --token-file and --token-stdin read a key too. Signing in with a key does not remove your Subscription sign-in.

A key can do only what its scopes allow, and the interactive conversation is not available with a key. Switch with chainabit auth use subscription or chainabit auth use api-key, and sign out with chainabit auth logout, adding --api-key, --subscription or --all to choose what to remove. See auth use and auth login.

Environment Variables ​

  • CHAINABIT_BASE_URL API base URL
  • CHAINABIT_TOKEN access token override
  • CHAINABIT_DEVELOPER_TOKEN developer token used with chainabit auth login --token-env
  • CHAINABIT_WORKSPACE_ID default workspace override
  • CHAINABIT_ENV_FILE trusted env file to load before command execution
  • CHAINABIT_CONFIG_DIR an absolute, non-root directory for isolated CLI state

Sign-In Behavior ​

  • Interactive sessions default to browser/device login.
  • Use --token-stdin, --token-env, or --token-file for non-interactive scripts and CI jobs.
  • Identifier/password login is a browser-oriented compatibility path and should not be the default automation strategy.
  • Use --device or --browser to force the browser-based flow.
  • Use --no-open when you want to open the returned URL manually.

Workspace Precedence ​

Workspace context is resolved in this order:

  1. command-specific overrides such as chao --workspace
  2. CHAINABIT_WORKSPACE_ID
  3. saved local configuration
  4. no selected workspace

If you want to pin the workspace locally, run:

bash
chainabit workspace use ws_123

Env File Loading ​

The CLI loads an environment file only when you name it explicitly:

  1. --env-file <path>
  2. CHAINABIT_ENV_FILE

It does not automatically discover .env, .env.local, or .env.production in the working directory. Choose a file you trust. Existing environment values are preserved when that file is loaded.

bash
chainabit --env-file /path/to/trusted.env workspace current

API URL precedence ​

The resolved API base comes from --api-url, then CHAINABIT_BASE_URL, then the saved configuration and its default.

API addresses must use https. Plain http is accepted only for localhost, loopback addresses such as 127.0.0.1, and ::1.

Stored sign-in and API address ​

A saved sign-in belongs to the API address it was created on. If --api-url or CHAINABIT_BASE_URL points to a different host, the saved credentials are not sent there. Sign in on that host, or supply a token with CHAINABIT_TOKEN, which works with any API address.

chainabit auth login saves the API address it signed in against, and that address becomes the default for later commands until the next login or until you override it. Signing in or out clears the saved default workspace, so run chainabit workspace use again afterwards.

Common Setup ​

bash
export CHAINABIT_BASE_URL="https://api.chainabit.com/api/v1"
export CHAINABIT_WORKSPACE_ID="ws_123"
export CHAINABIT_DEVELOPER_TOKEN="cbt_live_..."
chainabit auth login --token-env CHAINABIT_DEVELOPER_TOKEN
chainabit workspace current

Built with purpose. chainabit.com