Skip to main content

CLI tool to switch between different Claude Code API settings

Project description

CCswitcher

A CLI tool to easily switch between different API settings for Claude Code. Perfect for when you hit API limits and want to switch to alternative providers like DeepSeek, OpenRouter, or other compatible APIs.

Installation

Install the package in editable mode:

pip install -e .

Usage

Switch to a Profile

Switch to a registered profile (e.g., DeepSeek):

ccswitcher deepseek

This will copy the settings file from your registered path to ~/.claude/settings.json.

Switch to Default Claude

Switch back to default Claude settings (removes settings.json):

ccswitcher claude

Claude Code uses default settings when settings.json doesn't exist.

Register a New Profile

Register a new API provider profile:

ccswitcher new deepseek --path='~/.claude/settings_deepseek'

This saves the association between the profile name and settings file path in your configuration.

List All Profiles

View all registered profiles:

ccswitcher list

This shows all profiles with their paths and whether the settings files exist.

How It Works

  1. Configuration Storage: Profile mappings are stored in ~/.config/ccswitcher/settings.yml
  2. Settings Switching: When you switch profiles, the tool copies the corresponding settings file to ~/.claude/settings.json
  3. Default Mode: Switching to "claude" removes settings.json, making Claude Code use its default settings

Example Workflow

  1. First, create your alternative API settings file:

    # Create a settings file for DeepSeek
    cat > ~/.claude/settings_deepseek << EOF
    {
      "apiKey": "your-deepseek-api-key",
      "apiEndpoint": "https://api.deepseek.com",
      "model": "deepseek-chat"
    }
    EOF
    
  2. Register the profile:

    ccswitcher new deepseek --path='~/.claude/settings_deepseek'
    
  3. Switch between profiles as needed:

    # Use DeepSeek
    ccswitcher deepseek
    
    # Back to default Claude
    ccswitcher claude
    
    # Use DeepSeek again
    ccswitcher deepseek
    
  4. Check your registered profiles:

    ccswitcher list
    

Requirements

  • Python >= 3.7
  • click >= 8.0.0
  • pyyaml >= 5.0.0

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccswitcher-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccswitcher-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file ccswitcher-0.1.0.tar.gz.

File metadata

  • Download URL: ccswitcher-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for ccswitcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e099a236c09f13987300194c161767b83fee895b5ec50de1be3bf8acf4ce2fca
MD5 a40685fc7d6896bfcfe91f70b136ad81
BLAKE2b-256 9f2f814969d7565e7d3660093a5cf1009f953a31b7a622cc8a77fd97e1693c2c

See more details on using hashes here.

File details

Details for the file ccswitcher-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ccswitcher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for ccswitcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 742b694335055c5c7606638942def350f262224f5f2cca9bad4aab75047d3fb4
MD5 dd70a94de8358e83a1adfeb9e51dfce0
BLAKE2b-256 edb08c64326165d7d43a7f5b64b5812bbda8a41c025674086bb2e7c1cfdddd8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page