Skip to content

Claude Code API Switching Tool - Effortlessly manage multiple API providers and switch between them instantly. Supports running multiple simultaneous terminal sessions with different providers (e.g., DeepSeek in one, Kimi in another).

License

Notifications You must be signed in to change notification settings

punisher1/claude-code-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ claude-code-tool (cct)

English | δΈ­ζ–‡

GitHub Release Platform GitHub Downloads (all assets, all releases) License

Claude Code API Switching Tool - Effortlessly manage multiple API providers and switch between them instantly. Supports running multiple simultaneous terminal sessions with different providers (e.g., DeepSeek in one, Kimi in another).

Using multiple providers simultaneously

πŸ“‹ Table of Contents

🌟 Features

  • Multi-session Support: Open multiple terminal windows and run Claude Code with different providers in each one simultaneously.
  • Multi-provider Support: Easily switch between Anthropic official API and third-party compatible providers (DeepSeek, Kimi/Moonshot, Zhipu GLM, etc.)
  • Custom Providers: Add and manage custom API providers
  • Configuration Management: Create and manage multiple API configuration instances
  • One-click Switching: Quickly activate different API configurations
  • Launch & Run: Directly launch Claude Code with environment variables set for a specific configuration

πŸ“₯ Installation

Download from GitHub Release (Recommended)

Visit the Releases Page to download pre-compiled binaries for your platform:

  • Linux x86_64: cct-Linux-x86_64.tar.gz
  • macOS x86_64: cct-Darwin-x86_64.tar.gz
  • macOS Apple Silicon: cct-Darwin-aarch64.tar.gz
  • Windows x86_64: cct-Windows-x86_64.zip

After downloading, unzip and add the binary to your system PATH.

Build from Source

Ensure you have the Rust toolchain (1.70+) installed, then run:

# Clone the repository
git clone https://github.com/punisher1/claude-code-tool.git
cd claude-code-tool

# Build release version
cargo build --release

The executable will be generated at target/release/cct (or cct.exe on Windows).

πŸš€ Usage

List all providers

cct provider list

Add a custom provider

cct provider add [name]
# Or use interactive mode
cct provider add

Remove a custom provider

cct provider rm <name>

Add an API configuration

cct add -p <provider> -a <api_key> <alias>
# Example
cct add -p deepseek -a sk-xxx my-deepseek

Use a configuration

cct use <alias>
# Example
cct use my-deepseek

Start Claude Code

# Start Claude Code with a specific configuration
cct start <alias>
# Example
cct start my-deepseek

# Start and pass arguments to claude
cct start my-deepseek -- -p "hello claude"

# Start and set proxy
cct start my-deepseek --proxy "http://127.0.0.1:11225"

πŸ“‚ File Locations

  • Config File: ~/.cct/config.toml (macOS/Linux) or %USERPROFILE%\.cct\config.toml (Windows)
  • Claude Settings: ~/.claude/settings.json (macOS/Linux) or %USERPROFILE%\.claude\settings.json (Windows)

πŸ”Œ Supported Providers

Built-in Providers

  • claude-code - Anthropic Claude Code (Official)
  • deepseek - DeepSeek API
  • kimi-coding - Kimi for Coding (Moonshot API)
  • zhipu - Zhipu GLM API
  • xiaomi-mimo - Xiaomi Mimo Coding
  • minimaxi-m2 - Minimax M2 Coding

Custom Providers

Supports adding any third-party provider compatible with the Anthropic API format.

βš™οΈ Technical Features

Environment Variable Type Support

Environment variables in the configuration file support three types:

  • String: For text values like URLs, API keys
  • Int: For numeric configurations like timeouts, flags
  • Bool: For true/false configuration options

Example configuration:

[providers.deepseek]
description = "DeepSeek API"
env.ANTHROPIC_BASE_URL = "https://api.deepseek.com"
env.ANTHROPIC_MODEL = "deepseek-chat"
env.API_TIMEOUT_MS = 3000000  # Integer type
env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = 1  # Integer flag

πŸ‘¨β€πŸ’» Development

Run Tests

cargo test

Development Build

cargo build

Release Build

cargo build --release

Create Release

The project uses GitHub Actions to automate the release process. To create a new version:

  1. Create and push a tag:

    git tag v0.1.0
    git push origin v0.1.0
  2. GitHub Actions execution:

    • Builds binaries for Linux, macOS, and Windows
    • Creates a GitHub Release
    • Automatically generates Release Notes
    • Uploads binaries and checksums for all platforms
  3. Check results on the GitHub Release page:

    • Auto-generated Release Notes (based on commit categories)
    • Pre-compiled binaries for all platforms
    • SHA256 checksum for each binary

The release workflow is configured in .github/workflows/release.yml.

Code Formatting

cargo fmt

Code Linting

cargo clippy

πŸ“„ License

MIT License

About

Claude Code API Switching Tool - Effortlessly manage multiple API providers and switch between them instantly. Supports running multiple simultaneous terminal sessions with different providers (e.g., DeepSeek in one, Kimi in another).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages