Skip to main content

Claude Code Manager (ccm)

Switch Claude Code's Base URL / API Key / Model in one command. No more editing ~/.bashrc and source-ing it every time you change providers.

Features

  • Profiles — group a base URL, API key, and model set into a named profile
  • One-command launchccm run starts Claude Code with the active profile
  • Shell-friendlyeval "$(ccm env <name>)" updates your current shell
  • Deterministic env — managed ANTHROPIC_* variables not defined by a profile are cleared, so stale values never leak in
  • Secure by default — config directory is 0700, config file is 0600

Installation

From PyPI

pip install ccm-cli

Or, for an isolated global ccm binary:

pipx install ccm-cli
# or with uv
uv tool install ccm-cli

pip install puts the ccm command into the current Python environment's bin directory (e.g. venv/bin/ccm or ~/.local/bin/ccm with --user). pipx / uv tool install it into an isolated environment with a globally available ccm.

From source (for development)

If you want to work on the code itself:

git clone <repo-url>
cd claude-code-manager
uv tool install .
# or editable, so code changes take effect immediately
uv tool install --editable .

Requires Python 3.9+.

Quickstart

# Create a profile (interactive prompts; or pass --url/--key/--model)
ccm add volcengine
ccm add deepseek --url https://api.deepseek.com --key sk-xxxx --model deepseek-chat

# List, set default, launch
ccm list
ccm use deepseek
ccm run

# Launch a specific profile, passing extra args through to claude
ccm run volcengine -- --dangerously-skip-permissions

# Apply to the current shell
eval "$(ccm env deepseek)"

Commands

Command Description
ccm / ccm list List all profiles (the default is marked with *)
ccm current Show the active default profile
ccm add <name> Create a profile (interactive; or --url/--key/--model/--sonnet/--opus/--haiku)
ccm use <name> Set the default profile
ccm run [name] Launch claude with a profile; extra args are passed through
ccm resume [name] Launch claude --resume to pick a past session
ccm env [name] Print export/unset statements to eval in the current shell
ccm remove <name> Delete a profile (-y to skip confirmation)
ccm config Print the config directory path

Configuration

Stored in ~/.config/ccm/profiles.yaml (override with CCM_CONFIG_DIR).

default: volcengine
profiles:
  volcengine:
    base_url: https://ark.cn-beijing.volces.com/api/plan
    api_key: ark-xxxx
    model: deepseek-v4-flash[1m]
    default_sonnet_model: deepseek-v4-flash[1m]
    default_opus_model: deepseek-v4-flash[1m]
    default_haiku_model: deepseek-v4-flash[1m]
    # env:  # optional: pass through arbitrary extra env vars
    #   ANTHROPIC_CUSTOM_HEADERS: '{"x-foo": "bar"}'

Field to environment variable mapping

Field Environment variable
base_url ANTHROPIC_BASE_URL
api_key ANTHROPIC_API_KEY
model ANTHROPIC_MODEL
small_fast_model ANTHROPIC_SMALL_FAST_MODEL
default_sonnet_model ANTHROPIC_DEFAULT_SONNET_MODEL
default_opus_model ANTHROPIC_DEFAULT_OPUS_MODEL
default_haiku_model ANTHROPIC_DEFAULT_HAIKU_MODEL

Model slots

ANTHROPIC_MODEL sets the main model. The other slots control what Claude Code uses for specific roles: the small/fast (Haiku) slot for background work such as auto-compaction and title generation, and the Sonnet / Opus / Haiku tiers you can select with Shift+Tab or /model. With a custom endpoint, point every slot at your model, or background tasks will reach your endpoint with default Anthropic model names and fail.

ccm add syncs --model to all slots by default. Pass --no-sync to only set ANTHROPIC_MODEL, or override individual slots with --sonnet/--opus/--haiku/--small-fast.

Resuming sessions

ccm resume              # claude --resume: pick a past session (default profile)
ccm resume deepseek     # same, with a specific profile
ccm run deepseek --resume   # also works: extra args pass through to claude

Choosing the claude binary

ccm run uses the first claude found on PATH. If that resolves to the wrong binary (for example, a broken npm-installed stub shadowing a working install), override it with CCM_CLAUDE, which takes precedence over the PATH lookup:

CCM_CLAUDE=/usr/local/bin/claude ccm run

Design notes

  • No .bashrc hacks, no parent-shell mutation. ccm run uses os.execvpe to replace itself with claude; ccm env goes through eval when you want to affect the current shell. A child process can never change its parent's environment.
  • Deterministic managed vars. When running, managed variables that a profile does not define are removed from the environment; ccm env emits unset lines for them first. Switching is always predictable.
  • Schema decoupled from Claude Code. Profiles store business fields; env vars are generated at launch time from ENV_VAR_MAP in src/ccm/config.py. If Claude Code renames or adds env vars, update the map in one place — no profile migration needed.
  • API keys are stored in the config file (no system keyring in v1, because WSL2 has no Secret Service daemon by default). The config directory is 0700 and the file is 0600.

Development

See CONTRIBUTING.md for setup, testing, and contribution guidelines.

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccm_cli-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccm_cli-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file ccm_cli-0.1.0.tar.gz.

File metadata

  • Download URL: ccm_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccm_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0e2484ec72090c8786cc93e2ca750e8642803ed1d7f951372342a81572c9abf7
MD5 1c948c66f8c1ce5fcfc8b6872cf1eb1f
BLAKE2b-256 fbd768b5d50dea81f06146d1bdc64773db324447a9d297f9b65ee9c847f7bbcc

See more details on using hashes here.

File details

Details for the file ccm_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ccm_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccm_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f987bc6587d479249f96d23c258b7c8c57acc4cebc992ff08d61f3357924376c
MD5 e11cc08b1558d026bebd3280e5aa609b
BLAKE2b-256 8c78846ecbd0b4531a06e1b0fd6460cad104b8e0caad6ad9caa6156bb7ee78b3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page