Claude Code Tools

claude-provider

official

CLI tool and Claude Code plugin to switch between API providers (Anthropic, Kimi, Qwen, DeepSeek, MiniMax, Z.ai)

Version
0.0.5
Last Updated
2026-02-02
Source
official

Claude Provider

Plugin & CLI tool to switch between LLM providers in Claude Code

npm version License: MIT Node.js


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.

✨ Features

  • 🔄 Instant Provider Switching — Switch between providers with a single command
  • Dual Mode — Use as a Claude Code plugin or standalone CLI tool
  • 📦 Pre-configured Presets — Ready-to-use configurations for popular providers
  • 🎛️ Custom Configurations — Create profiles with custom base URLs and models
  • 📸 Profile Snapshots — Save your current settings as reusable profiles
  • 🔐 Secure — API keys are masked in output; file permissions are restricted

🚀 Installation

Prerequisites

npm install -g claude-provider

This installs both the Claude Code plugin and the CLI tool.

🔌 Plugin Usage

Use the provider commands directly within Claude Code via slash commands.

Setup Plugin

Via Marketplace:

# Add the marketplace
/plugin marketplace add iqbal-rashed/claude-provider-plugin

# Install the plugin
/plugin install provider@claude-provider-plugin

Plugin Commands

Switch Provider

/provider:switch <profile_name>

Switch to a different provider profile instantly.

List Profiles

/provider:list

View all available profiles and see which one is currently active.

Add Provider

/provider:add <name>

Create a new profile from a preset or custom configuration. You’ll be prompted for:

  • Preset — Choose from available presets or custom
  • API Key — Your provider’s API key
  • Model (optional) — Override the default model

Snapshot Settings

/provider:snapshot <name>

Save your current ~/.claude/settings.json as a named profile for later use.

Delete Profile

/provider:delete <profile_name>

Remove a profile you no longer need.


📖 CLI Usage

After installation, you can use claude-provider or the shorthand cpr from your terminal.

Interactive Mode

claude-provider
# or
cpr

Launches an interactive menu to:

  • View and switch between providers
  • Add new providers (from presets or custom)
  • Manage existing providers (edit/delete)

Quick Switch

claude-provider <provider_name>
# or
cpr kimi

Switch directly to a provider by name.

List Providers

claude-provider --list
# or
cpr -l

Display all installed providers with the active one highlighted.

Keychain Credential Swap (macOS, opt-in)

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.

# Snapshot the current keychain credential for the active profile
cpr credential save anthropic

# Restore a previously saved credential to the keychain
cpr credential restore anthropic

# List saved credentials
cpr credential list

# Auto-restore on switch (opt-in via env var)
CPR_SWAP_CREDENTIALS=1 cpr switch anthropic-team

macOS only. Without CPR_SWAP_CREDENTIALS the switch command never touches the keychain, so existing users are unaffected.


🎯 Supported Providers

ProviderPreset KeyDefault Model
Anthropicanthropicclaude-sonnet-4.5
Z.ai (GLM)zaiglm-4.7
MiniMaxminimaxminimax-m2.1
Kimi (Moonshot)kimikimi-k2.5
Qwen (DashScope)qwenqwen-max-latest
DeepSeekdeepseekdeepseek-chat
CustomcustomUser defined

💡 Tip: When using a preset, you can optionally specify a custom model to override the default.


🔧 How It Works

  1. Profiles are stored as ~/.claude/settings.<name>.json
  2. Switching copies the target profile to ~/.claude/settings.json
  3. Plugins preserved — Your enabled plugins are maintained when switching providers
  4. MCP Protocol ensures safe, structured file system interactions (plugin mode)

🐛 Troubleshooting

IssueSolution
Command not foundRun npm install -g claude-provider or check your PATH
Plugin not foundEnsure you used the absolute path to the plugin directory
Command not recognizedRestart Claude Code after installing the plugin

📄 License

MIT © Rashed Iqbal