byiqbal-rashed· 1 MCP server
CLI tool and Claude Code plugin to switch between API providers (Anthropic, Kimi, Qwen, DeepSeek, MiniMax, Z.ai, Fireworks)
$git clone https://github.com/iqbal-rashed/claude-provider-pluginInstalls into the current project.
Install claude-provider-plugin by running `git clone https://github.com/iqbal-rashed/claude-provider-plugin`, then use it for the current task and follow its documentation at https://github.com/iqbal-rashed/claude-provider-plugin.
| 1 | <p align="center"> |
| 2 | <h1 align="center">Claude Provider</h1> |
| 3 | <p align="center"> |
| 4 | <strong>Plugin & CLI tool to switch between LLM providers in Claude Code</strong> |
| 5 | </p> |
| 6 | <p align="center"> |
| 7 | <a href="https://www.npmjs.com/package/claude-provider"><img src="https://img.shields.io/npm/v/claude-provider.svg" alt="npm version"></a> |
| 8 | <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> |
| 9 | <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg" alt="Node.js"></a> |
| 10 | </p> |
| 11 | </p> |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | A powerful tool that enables you to manage and switch between multiple LLM API providers for Claude Code. Available as both a **Claude Code plugin** and a **standalone CLI**. |
| 16 | |
| 17 | ## ✨ Features |
| 18 | |
| 19 | - 🔄 **Instant Provider Switching** — Switch between providers with a single command |
| 20 | - � **Dual Mode** — Use as a Claude Code plugin or standalone CLI tool |
| 21 | - 📦 **Pre-configured Presets** — Ready-to-use configurations for popular providers |
| 22 | - 🎛️ **Custom Configurations** — Create profiles with custom base URLs and models |
| 23 | - 📸 **Profile Snapshots** — Save your current settings as reusable profiles |
| 24 | - 🔐 **Secure** — API keys are masked in output; file permissions are restricted |
| 25 | |
| 26 | ## 🚀 Installation |
| 27 | |
| 28 | ### Prerequisites |
| 29 | |
| 30 | - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed |
| 31 | - Node.js v18 or higher |
| 32 | |
| 33 | ### Install via npm (Recommended) |
| 34 | |
| 35 | ```bash |
| 36 | npm install -g claude-provider |
| 37 | ``` |
| 38 | |
| 39 | This installs both the Claude Code plugin and the CLI tool. |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | ## 🔌 Plugin Usage |
| 45 | |
| 46 | Use the provider commands directly within Claude Code via slash commands. |
| 47 | |
| 48 | ### Setup Plugin |
| 49 | |
| 50 | **Via Marketplace:** |
| 51 | |
| 52 | ```bash |
| 53 | # Add the marketplace |
| 54 | /plugin marketplace add iqbal-rashed/claude-provider-plugin |
| 55 | |
| 56 | # Install the plugin |
| 57 | /plugin install provider@claude-provider-plugin |
| 58 | ``` |
| 59 | |
| 60 | ### Plugin Commands |
| 61 | |
| 62 | #### Switch Provider |
| 63 | ``` |
| 64 | /provider:switch <profile_name> |
| 65 | ``` |
| 66 | Switch to a different provider profile instantly. |
| 67 | |
| 68 | #### List Profiles |
| 69 | ``` |
| 70 | /provider:list |
| 71 | ``` |
| 72 | View all available profiles and see which one is currently active. |
| 73 | |
| 74 | #### Add Provider |
| 75 | ``` |
| 76 | /provider:add <name> |
| 77 | ``` |
| 78 | Create a new profile from a preset or custom configuration. You'll be prompted for: |
| 79 | - **Preset** — Choose from available presets or `custom` |
| 80 | - **API Key** — Your provider's API key |
| 81 | - **Model** *(optional)* — Override the default model |
| 82 | |
| 83 | #### Snapshot Settings |
| 84 | ``` |
| 85 | /provider:snapshot <name> |
| 86 | ``` |
| 87 | Save your current `~/.claude/settings.json` as a named profile for later use. |
| 88 | |
| 89 | #### Delete Profile |
| 90 | ``` |
| 91 | /provider:delete <profile_name> |
| 92 | ``` |
| 93 | Remove a profile you no longer need. |
| 94 | |
| 95 | --- |
| 96 | |
| 97 | ## 📖 CLI Usage |
| 98 | |
| 99 | After installation, you can use `claude-provider` or the shorthand `cpr` from your terminal. |
| 100 | |
| 101 | ### Interactive Mode |
| 102 | |
| 103 | ```bash |
| 104 | claude-provider |
| 105 | # or |
| 106 | cpr |
| 107 | ``` |
| 108 | |
| 109 | Launches an interactive menu to: |
| 110 | - View and switch between providers |
| 111 | - Add new providers (from presets or custom) |
| 112 | - Manage existing providers (edit/delete) |
| 113 | |
| 114 | ### Quick Switch |
| 115 | |
| 116 | ```bash |
| 117 | claude-provider <provider_name> |
| 118 | # or |
| 119 | cpr kimi |
| 120 | ``` |
| 121 | |
| 122 | Switch directly to a provider by name. |
| 123 | |
| 124 | ### List Providers |
| 125 | |
| 126 | ```bash |
| 127 | claude-provider --list |
| 128 | # or |
| 129 | cpr -l |
| 130 | ``` |
| 131 | |
| 132 | Display all installed providers with the active one highlighted. |
| 133 | |
| 134 | ### Keychain Credential Swap (macOS, opt-in) |
| 135 | |
| 136 | When multiple profiles target the same Anthropic account (e.g. a Pro plan and a Team plan on one login), settings.json alone isn't enough to switch — Claude Code authenticates via an OAuth blob in the macOS keychain. The `credential` subcommand snapshots that blob per profile so `switch` can restore the correct one. |
| 137 | |
| 138 | ```bash |
| 139 | # Snapshot the current keychain credential for the active profile |
| 140 | cpr credential save anthropic |
| 141 | |
| 142 | # Restore a previously saved credential to the keychain |
| 143 | cpr credential restore anthropic |
| 144 | |
| 145 | # List saved credentials |
| 146 | cpr credential list |
| 147 | |
| 148 | # Auto-restore on switch (opt-in via env var) |
| 149 | CPR_SWAP_CREDENTIALS=1 cpr switch anthropic-team |
| 150 | ``` |
| 151 | |
| 152 | macOS only. Without `CPR_SWAP_CREDENTIALS` the `switch` command never touches the keychain, so existing users are unaffected. |
| 153 | |
| 154 | --- |
| 155 | |
| 156 | ## 🎯 Supported Providers |
| 157 | |
| 158 | | Provider | Preset Key | Default Model | |
| 159 | |----------|-----------|---------------| |
| 160 | | **Anthropic** | `anthropic` | `claude-sonnet-4.5` | |
| 161 | | **Z.ai (GLM)** | `zai` | `glm-4.7` | |
| 162 | | **MiniMax** | `minimax` | `minimax-m2.1` | |
| 163 | | **Kimi (Moonshot)** | `kimi` | `kimi-k2.5` | |
| 164 | | **Qwen (DashScope)** | `qwen` | `qwen-max-latest` | |
| 165 | | **DeepSeek** | `deepseek` | `deepseek-chat` | |
| 166 | | **Custom** | `custom` | *User defined* | |
| 167 | |
| 168 | > 💡 **Tip:** When using a preset, you can optionally specify a custom model to override the default. |
| 169 | |
| 170 | --- |
| 171 | |
| 172 | ## 🔧 How It Works |
| 173 | |
| 174 | 1. **Profiles** are stored as `~/.claude/settings.<name>.json` |
| 175 | 2. **Switching** copies the target profile to `~/.claude/settings.json` |
| 176 | 3. **Plugins preserved** — Your enabled plugins are maintained when switching providers |
| 177 | 4. **MCP Protocol** ensures safe, structured file system interactions (plugin mode) |
| 178 | |
| 179 | --- |
| 180 | |
| 181 | ## 🐛 Troubleshooting |
| 182 | |
| 183 | | Issue | Solution | |
| 184 | |-------|----------| |