JSPM

claudegate

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q37880F
  • License MIT

Terminal utility to switch between AI provider configurations for Claude CLI

Package Exports

  • claudegate
  • claudegate/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (claudegate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ClaudeGate

A gateway for Claude CLI that enables seamless switching between AI providers

npm version npm downloads Node.js License CI

GitHub stars GitHub forks


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 claudegate

Quick 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
  1. Select Profile — Choose which AI provider to use
  2. Launch Claude — Claude CLI starts with the correct environment
  3. 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:

  1. Choose a provider (Z.AI, OpenRouter, DeepSeek, MiniMax, etc.)
  2. Enter a profile name (e.g., work-deepseek)
  3. Enter required credentials (API keys, endpoints)
  4. Select models for Haiku, Sonnet, and Opus tiers
  5. 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

Z.AI (GLM Models)
  • 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
DeepSeek
  • 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
MiniMax (M2 Models)
  • 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
OpenRouter
  • Access 320+ models from multiple providers
  • Endpoint: https://openrouter.ai/api
  • Get API key: openrouter.ai/keys
Moonshot (Kimi K2)
  • 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 0600 permissions (owner read/write only)
  • API keys stored locally, never transmitted except to configured providers
  • Sensitive values masked during input

Troubleshooting

Claude CLI not found
which claude  # Should show Claude CLI path

If not found, install Claude CLI first: docs.anthropic.com/en/docs/claude-code

Permission denied
chmod 700 ~/.claudegate
chmod 600 ~/.claudegate/config.json
Provider connection issues

Use the "Test" option in profile management to verify credentials.

Model fetch failed

If live model fetching fails:

  1. Check your API key is valid
  2. Fallback models will be shown
  3. You can always enter a custom model ID

Uninstall

npm uninstall -g claudegate
rm -rf ~/.claudegate

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

This project uses Conventional Commits for automatic versioning.

Star History

Star History Chart

License

MIT


Made with Claude Code