Integrate with TokenCode CLI

TokenCode CLI configures common coding tools through an interactive wizard or one-line commands. It merges your API key, Base URL, and default model into each tool's native configuration while preserving unrelated settings.

TokenCode CLI startup screen

Install and run

bash
npm install -g @tokencode/tokencode
tokencode

You can also run the same wizard without a global installation:

bash
npx @tokencode/tokencode

The tcd and tkc aliases are also available.

Interactive wizard

Run tokencode, then:

  1. Select the coding tool to configure.
  2. Enter your TokenCode API key.
  3. Confirm or change the Base URL.
  4. Select or enter a default model.
  5. Let the CLI merge the values into the tool's configuration.

Supported tools

Tool Commands Configuration files
Claude Code cc, claude ~/.claude/settings.json
OpenAI Codex codex, cx ~/.codex/config.toml, ~/.codex/auth.json
OpenCode opencode, od ~/.config/opencode/opencode.json
OpenClaw openclaw, oc ~/.openclaw/openclaw.json
Hermes Agent hermes, hm ~/.hermes/config.yaml, ~/.hermes/.env
Atomcode atomcode, ac ~/.atomcode/config.toml

One-line setup

Replace sk-your-api-key with your TokenCode API key. Change --model to any available model ID.

bash
npx @tokencode/tokencode cc -k sk-your-api-key -m claude-sonnet-4-6
npx @tokencode/tokencode cx -k sk-your-api-key -m gpt-5.5
npx @tokencode/tokencode od -k sk-your-api-key -m claude-sonnet-4-6
npx @tokencode/tokencode oc -k sk-your-api-key -m claude-sonnet-4-6
npx @tokencode/tokencode hm -k sk-your-api-key -m claude-sonnet-4-6
npx @tokencode/tokencode ac -k sk-your-api-key -m claude-sonnet-4-6

Common options

Option Purpose
--key / -k Set the TokenCode API key
--url / -u Set the Base URL
--model / -m Set the default model
--show / -s Show the current configuration
bash
tokencode cc --show
tokencode cx --show
tokencode od --show

Default Base URLs

Tool Default Base URL
Claude Code https://tokencode.dev
Codex https://tokencode.dev/v1
OpenCode https://tokencode.dev/v1
OpenClaw https://tokencode.dev/v1
Hermes Agent https://tokencode.dev/v1
Atomcode https://tokencode.dev/v1

For a private deployment, override the URL with -u:

bash
tokencode cc -u https://your-domain.com
tokencode cx -u https://your-domain.com/v1

Troubleshooting

The configured tool still uses its official service

Run tokencode <command> --show and verify the Base URL, API key, and model. Reopen your terminal or restart the tool after updating its configuration.

401 or authentication failed

Check that the API key is complete, contains no extra spaces, and that your account has available balance. Run the CLI again to avoid using the wrong field name.

The model list cannot be loaded

You can still enter a model ID manually:

bash
tokencode cc -m claude-sonnet-4-6