A simple CLI to switch Claude Code between providers and models with predictable, explicit configuration.
# 1) Install
curl -fsSL https://raw.githubusercontent.com/foreveryh/claude-code-switch/main/quick-install.sh | bash
# 2) Reload shell
source ~/.zshrc # or ~/.bashrc
# 3) Configure keys
ccm config
# 4) Switch provider
ccm kimi
ccm qwen china
# 5) Launch Claude Code with one command
ccc glm globalcurl -fsSL https://raw.githubusercontent.com/foreveryh/claude-code-switch/main/quick-install.sh | bashgit clone https://github.com/foreveryh/claude-code-switch.git
cd claude-code-switch
./install.shBy default the installer injects ccm() / ccc() into your shell rc file so you can run ccm <provider> directly.
If you do not want rc injection:
./install.sh --no-rc./uninstall.shIf you installed with rc injection, just run:
ccm deepseek
ccm kimi chinaIf you are running from the repo without rc injection:
eval "$(./ccm deepseek)"ccc kimi # switch model then launch Claude Code
ccc qwen global
ccc open kimi # OpenRouterAll providers below require their own API key, except Claude (official) which can use your Claude Code subscription (or API key if configured).
-
DeepSeek
- Command:
ccm deepseek - Base URL:
https://api.deepseek.com/anthropic - Models:
deepseek-chat(default) - Default models for Claude Code:
deepseek/deepseek-v3.2
- Command:
-
Kimi (default: global)
- Command:
ccm kimi [global|china] - Global Base URL:
https://api.moonshot.ai/anthropic - China Base URL:
https://api.moonshot.cn/anthropic - Global model:
kimi-for-coding - China model:
kimi-k2.5
- Command:
-
Qwen (Coding Plan) (default: global)
- Command:
ccm qwen [global|china] - Global Base URL:
https://coding-intl.dashscope.aliyuncs.com/apps/anthropic - China Base URL:
https://coding.dashscope.aliyuncs.com/apps/anthropic - Main model:
qwen3-max-2026-01-23 - Haiku default:
qwen3-coder-plus - Default models: OPUS/SONNET = main, HAIKU =
qwen3-coder-plus
- Command:
-
GLM (default: global)
- Command:
ccm glm [global|china] - Global Base URL:
https://api.z.ai/api/anthropic - China Base URL:
https://open.bigmodel.cn/api/anthropic - Model:
glm-4.7
- Command:
-
MiniMax (default: global)
- Command:
ccm minimax [global|china] - Global Base URL:
https://api.minimax.io/anthropic - China Base URL:
https://api.minimaxi.com/anthropic - Model:
MiniMax-M2.1
- Command:
-
Doubao / Seed (ARK)
- Command:
ccm seed [doubao|glm|deepseek|kimi] - Base URL:
https://ark.cn-beijing.volces.com/api/coding - Default model:
ark-code-latest - Variants:
ccm seed doubao→doubao-seed-codeccm seed glm→glm-4.7ccm seed deepseek→deepseek-v3.2ccm seed kimi→kimi-k2.5
- Command:
-
Claude (official)
- Command:
ccm claude - Base URL:
https://api.anthropic.com/ - Uses your Claude Code subscription unless you set
CLAUDE_API_KEY
- Command:
OpenRouter is not a fallback. Use it only when you call ccm open ....
ccm open # prints supported providers and usage
ccm open kimiSupported providers:
claude(default)deepseekkimiglmqwenminimax
OpenRouter defaults:
- Base URL:
https://openrouter.ai/api - Uses
OPENROUTER_API_KEY - Sets
ANTHROPIC_API_KEY=""to avoid conflicts
ccm project glm [global|china]
ccm project resetThis writes/removes .claude/settings.local.json in the current project so you can keep global settings (e.g. Quotio) while forcing GLM only in one project.
ccm status
ccm configccm save-account work
ccm switch-account work
ccm list-accounts
ccm delete-account work
ccm current-accountConfiguration priority:
- Environment variables
~/.ccm_config
Edit config:
ccm configExample ~/.ccm_config:
# API keys
DEEPSEEK_API_KEY=sk-...
KIMI_API_KEY=...
GLM_API_KEY=...
QWEN_API_KEY=...
MINIMAX_API_KEY=...
ARK_API_KEY=...
OPENROUTER_API_KEY=...
# Optional overrides
DEEPSEEK_MODEL=deepseek-chat
KIMI_MODEL=kimi-for-coding
KIMI_CN_MODEL=kimi-k2.5
QWEN_MODEL=qwen3-max-2026-01-23
GLM_MODEL=glm-4.7
MINIMAX_MODEL=MiniMax-M2.1
SEED_MODEL=ark-code-latest
CLAUDE_MODEL=claude-sonnet-4-5-20250929
# These set default model names used by Claude Code (ANTHROPIC_DEFAULT_*):
OPUS_MODEL=claude-opus-4-5-20251101
HAIKU_MODEL=claude-haiku-4-5-20251001- If you do not use rc injection, run
eval "$(./ccm <provider>)"to apply env vars (oreval "$(ccm <provider>)"ifccmis on PATH). - CCM only exports these 7 vars per provider:
ANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN,ANTHROPIC_MODEL,ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_DEFAULT_HAIKU_MODEL,CLAUDE_CODE_SUBAGENT_MODEL. OpenRouter follows its own requirements. ccm openprints supported providers and correct usage.ccm project glmonly affects the current project via.claude/settings.local.json.