oxagenDocs
CLI

Account setup

Get an Oxagen account, mint an Oxagen API key, and authenticate the CLI.

The CLI needs one credential: an Oxagen API key (ox_…) plus the org and workspace it acts in. The key identifies you, the person running the CLI, to the Oxagen API. The CLI makes no LLM calls of its own, so there is no model provider key to configure.

oxagen cost, oxagen logs, and oxagen telemetry work without a credential. Most platform commands need authentication. oxagen agent enroll uses your CLI login, or the one-time token from agent registration when you pass --token.

Install the CLI

Install the CLI with npm on every machine you enroll:

sh
npm install -g @oxagen/cli

Installing the CLI covers the Node.js versions it needs and the single executable for a machine without Node.js.

1. Get your Oxagen account

  1. Open app.oxagen.sh/signup. Enter your name, your work email, and a password, then select Create account. To start from the terminal instead, run oxagen login --signup, which opens the same page. Anyone can create an account.
  2. Open the link Oxagen emails you to verify the address.
  3. On Name your organization, enter the organization's name, check its address and namespace, and click Continue. The namespace takes 2 to 6 characters and never changes, because every agent key starts with it.
  4. On Connect a code host, connect GitHub or GitLab. Each workspace keeps its steering records in a steering repo there.
  5. On Create the first workspace, name the workspace, click Create, then click Continue.

Two onboarding steps follow: Wrap an agent and Start a run. Once the first run reaches Oxagen, the app opens the workspace's Runs page at /{org}/{workspace}. Note your org slug and workspace slug. Workspace pages sit under /{org}/{workspace}/…, and the CLI needs both slugs.

For a full tour of the app, see Getting started.

2. Mint an Oxagen API key

The CLI authenticates to the platform with an API key (ox_…), not your password. The browser sign-in under Authenticate the CLI, below, makes a key for the CLI itself, so you need to make one here only for oxagen login --token, such as in CI or on a machine with no browser:

  1. In the app, open Organization, then the API keys tab.
  2. Click Create key, enter a name, and keep or change who it is assigned to, its workspaces, its permissions, and when it expires. Then click Create key. See Authentication.
  3. Copy the key now. It is shown only once.

A key acts as the person it is assigned to, in one workspace or every workspace they can open. The CLI sends the key as a Bearer token.

3. Authenticate the CLI

Run oxagen login. The default flow opens a browser sign-in page:

bash
oxagen login            # opens a browser; follow the prompt, then pick your org and workspace

After you sign in, the consent page asks which org and workspace the CLI acts in. Both pickers stay open even when you belong to only one. When you approve, the browser lands on app.oxagen.sh/cli/complete, and the token is already in your terminal. To preselect the org and workspace and skip the picker:

bash
oxagen login --org your-org-slug --workspace your-workspace-slug

For CI and headless environments, pass the key directly. There is no browser and no interactive prompt:

bash
oxagen login --token ox_… --org your-org-slug --workspace your-workspace-slug

To sign out, run oxagen logout. It revokes this machine's sign-in on the server, so the stored key stops working, then clears the stored login. If the server can't be reached, it still clears the login and warns that the key may still work. You can also revoke any of your command-line sign-ins in the app: open Account settings, choose Security, and find it under Command-line sign-ins. A token you passed with --token is an API key, not a sign-in, so oxagen logout leaves it working.

bash
oxagen logout

Confirm the credentials work:

bash
oxagen graph search -q "workspace context" --limit 1

Use environment variables instead

Every value also reads from the environment, which suits CI and provisioning scripts that must not run an interactive flow. Environment variables take precedence over the config file:

bash
export OXAGEN_API_TOKEN="ox_…"
export OXAGEN_ORG_ID="your-org-slug"
export OXAGEN_WORKSPACE_ID="your-workspace-slug"

To target a self-hosted or staging API, set OXAGEN_API_URL. It defaults to https://api.oxagen.sh.

Where credentials live

FileContents
~/.config/oxagen/config.jsonYour Oxagen API key (token), orgSlug, workspaceSlug, and appUrl, written by oxagen login, plus your oxagen telemetry choice. The CLI also reads an apiUrl you add by hand. OXAGEN_API_URL overrides it.
~/.config/oxagen/machine-idA random id for this machine. oxagen init sends a hash of it, never the id itself, when it reports a directory.

The config file holds a secret. It lives under your home directory with your user permissions. Keep it off shared machines and out of version control.

The CLI writes no file into a project. A <project>/.oxagen/workspace.json that an earlier CLI wrote is never read, so you can delete it.

Next step

You're authenticated. Go to the CLI quickstart to link a project and read your first run.

On this page