claudegate
v1.0.1
Published
Terminal utility to switch between AI provider configurations for Claude CLI
Maintainers
Readme
ClaudeGate
ClaudeGate is a terminal utility that wraps Claude CLI, enabling you to switch between multiple AI providers (Anthropic, OpenRouter, DeepSeek, Z.AI, MiniMax, Kimi K2, and more) without modifying your Claude configuration. Select your provider, choose your models, and start coding.
Why ClaudeGate?
Claude CLI is powerful, but switching between different AI providers requires manually setting environment variables or editing config files. ClaudeGate solves this by providing:
- One-click provider switching — Interactive menu to select your AI backend
- Dynamic model selection — Fetch and select models directly from provider APIs
- Three-tier model mapping — Configure Haiku, Sonnet, and Opus alternatives
- Profile management — Save multiple configurations for different use cases
- Zero config pollution — Never modifies your
~/.claude/settings.json - Full CLI passthrough — All Claude arguments work exactly as expected
Supported Providers
| Provider | Description | Live Model Fetching | |----------|-------------|:-------------------:| | Anthropic | Native Claude CLI configuration | — | | Z.AI | Cost-effective GLM-4.6/4.7 models | ✓ | | OpenRouter | Access 320+ models through single API | ✓ | | Kimi K2 | Up to 90% cost savings with Moonshot AI | ✓ | | MiniMax | Agent-native M2/M2.1 models for coding | ✓ | | DeepSeek | 128K context models with reasoning | ✓ | | Novita AI | Novita AI provider support | ✓ | | Custom | LiteLLM, HuggingFace TGI, any compatible endpoint | — |
Get Started
Prerequisites
- Node.js >= 18.0.0
- Claude CLI installed and configured
- API keys for your desired providers
Installation
npm install -g claudegateQuick Start
# Launch ClaudeGate - shows profile selector, then starts Claude
claudegate
# Or use the short alias
cc
# All Claude CLI arguments work as expected
claudegate -p "explain this code"
claudegate --resume
cc -p "help me debug this"How It Works
┌─────────────────────────────────────────────────────────────┐
│ CLAUDEGATE │
└─────────────────────────────────────────────────────────────┘
? Select active profile:
❯ ● work-anthropic (Anthropic) [current]
zai-dev (Z.AI - GLM Models)
openrouter-gpt4 (OpenRouter)
deepseek-v3 (DeepSeek)
minimax-m2 (MiniMax)
─────────────────────────────────────
+ Add new profile
⚙ Manage profiles- Select Profile — Choose which AI provider to use
- Launch Claude — Claude CLI starts with the correct environment
- Work normally — All your usual Claude workflows just work
Features
Dynamic Model Selection
ClaudeGate fetches available models live from provider APIs. When creating or editing a profile, you can select models for each tier:
? Select model for HAIKU (fast/cheap tasks):
○ Skip (use provider default)
○ deepseek-chat (Recommended)
○ deepseek-reasoner
○ Enter custom model ID...
? Select model for SONNET (balanced tasks):
○ Skip (use provider default)
○ deepseek-chat (Recommended)
○ deepseek-reasoner
○ Enter custom model ID...
? Select model for OPUS (complex reasoning):
○ Skip (use provider default)
○ deepseek-reasoner (Recommended)
○ deepseek-chat
○ Enter custom model ID...Three-tier model mapping: | Tier | Use Case | |------|----------| | Haiku | Fast/cheap tasks (quick edits, simple queries) | | Sonnet | Balanced tasks (most common usage) | | Opus | Complex reasoning (architecture, debugging) |
Models are saved with your profile—no need to reselect every time.
Profile Management
Adding a Profile
Select "+ Add new profile" from the menu:
- Choose a provider (Z.AI, OpenRouter, DeepSeek, MiniMax, etc.)
- Enter a profile name (e.g.,
work-deepseek) - Enter required credentials (API keys, endpoints)
- Select models for Haiku, Sonnet, and Opus tiers
- Profile is saved and ready to use
Managing Profiles
Select "⚙ Manage profiles" to:
| Action | Description | |--------|-------------| | Edit | Update profile name or credentials | | Change Models | Select different models for each tier | | Delete | Remove a profile | | Test | Verify configuration and view current models |
Provider Setup
- Models: GLM-4.7, GLM-4.6, GLM-4.5-air
- Endpoint:
https://api.z.ai/api/anthropic - Get API key: z.ai/manage-apikey
- Models: deepseek-chat (V3), deepseek-reasoner (thinking mode)
- Endpoint:
https://api.deepseek.com - Get API key: platform.deepseek.com
- 128K context window, extremely cost-effective
- Models: MiniMax-M2.1 (230B), MiniMax-M2
- Endpoint:
https://api.minimax.io/anthropic - Get API key: platform.minimax.io
- Optimized for coding and agentic workflows
- Access 320+ models from multiple providers
- Endpoint:
https://openrouter.ai/api - Get API key: openrouter.ai/keys
- Models: kimi-k2-0711-preview
- Endpoint:
https://api.moonshot.ai/anthropic - Get API key: platform.moonshot.ai
Configuration
Profiles are stored in ~/.claudegate/config.json:
{
"version": "1.0.0",
"activeProfileId": "abc-123",
"profiles": [
{
"id": "abc-123",
"name": "deepseek-dev",
"providerId": "deepseek",
"envVars": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxx",
"ANTHROPIC_BASE_URL": "https://api.deepseek.com"
},
"selectedModels": {
"haiku": { "id": "deepseek-chat", "name": "DeepSeek Chat V3" },
"sonnet": { "id": "deepseek-chat", "name": "DeepSeek Chat V3" },
"opus": { "id": "deepseek-reasoner", "name": "DeepSeek Reasoner" }
}
}
]
}Environment Variables
ClaudeGate sets these environment variables based on your profile:
| Variable | Description |
|----------|-------------|
| ANTHROPIC_BASE_URL | Provider API endpoint |
| ANTHROPIC_AUTH_TOKEN | API authentication token |
| ANTHROPIC_DEFAULT_HAIKU_MODEL | Model for Haiku-tier requests |
| ANTHROPIC_DEFAULT_SONNET_MODEL | Model for Sonnet-tier requests |
| ANTHROPIC_DEFAULT_OPUS_MODEL | Model for Opus-tier requests |
Security
- Config stored with
0600permissions (owner read/write only) - API keys stored locally, never transmitted except to configured providers
- Sensitive values masked during input
Troubleshooting
which claude # Should show Claude CLI pathIf not found, install Claude CLI first: docs.anthropic.com/en/docs/claude-code
chmod 700 ~/.claudegate
chmod 600 ~/.claudegate/config.jsonUse the "Test" option in profile management to verify credentials.
If live model fetching fails:
- Check your API key is valid
- Fallback models will be shown
- You can always enter a custom model ID
Uninstall
npm uninstall -g claudegate
rm -rf ~/.claudegateContributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project uses Conventional Commits for automatic versioning.
