Environment variables

Complete reference for environment variables that control O3 Code CLI behavior.

The O3 Code CLI supports the following environment variables to control its behavior. Set them in your shell before running o3-code, or export them from your shell profile (~/.zshrc, ~/.bashrc) or your CI environment to apply them across every session.

VariableDescription
O3_CODE_API_KEYAPI key (sk_live_… / sk_test_…) used in place of stored OAuth login. Equivalent to --api-key.
O3_CODE_STATE_ROOTDirectory the CLI uses for config.json and the host server tree. Default: ~/.o3/code. Shared with the desktop app.
GH_TOKEN / GITHUB_TOKENRead by the gh CLI the host server shells out to for PR checkout and metadata. Set this for sandboxes or CI instead of running gh auth login interactively.

The standalone install script also reads:

VariableDescription
O3_CODE_HOMEInstall root for the standalone CLI and host binary. Default: ~/o3-code.
O3_CODE_VERSIONRelease tag to install. Default: latest, which resolves through the rolling cli-latest release.

On this page

No Headings