A Go-based command-line tool to switch between different Claude Code API configurations.
- macOS/Linux: Direct binary execution with shell configuration updates
- Windows: Shell function wrapper for immediate environment variable changes
# Clone and build
git clone <repository_url>
cd ccc
make build
# Install (user-level, no sudo required)
./unix/install-mac.sh
# Initialize configuration
ccc init
# Switch providers
ccc qwen # 阿里云百炼
ccc k2 # Moonshot
ccc glm # 智谱
# Clone and build
git clone <repository_url>
cd ccc
make build
# Install with shell function wrapper
./windows/install-user.sh
# Initialize configuration
ccc init
# Switch providers (immediate effect)
ccc qwen # 阿里云百炼
ccc k2 # Moonshot
ccc glm # 智谱
- ✅ Cross-platform: Works on macOS, Linux, and Windows
- ✅ Multiple providers: Built-in support for Qwen, Moonshot, GLM, and custom providers
- ✅ Configuration persistence: Settings saved across terminal sessions
- ✅ Easy to use: Simple command-line interface
- ✅ No dependencies: Single binary with no external dependencies
Feature | macOS/Linux | Windows |
---|---|---|
Basic Mode | Direct binary | Direct binary |
Immediate Effect Mode | Optional shell function | Optional shell function |
Environment Variables | Next session (basic) or Immediate (shell function) | Next session (basic) or Immediate (shell function) |
Configuration | .zshrc /.bashrc |
.zshrc /.bashrc |
Installation | ./unix/install-mac.sh |
./windows/install-user.sh |
- qwen: 阿里云百炼 (Dashscope)
- k2: Moonshot AI
- glm: 智谱 AI (Big Model)
# User-level installation (recommended)
./unix/install-mac.sh
# System-level installation (requires sudo)
./unix/install.sh
# Manual installation
make build
mkdir -p ~/.local/bin
cp ccc ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"
After installation, configure your shell for immediate environment variable effects:
- Basic Mode: Environment variables take effect in the next terminal session
- Immediate Effect Mode: Configure shell functions for instant changes
For detailed shell function configuration, see SHELL_SETUP.md
.
# User-level installation with shell function wrapper
./windows/install-user.sh
# System-level installation
./windows/setup.sh
# Initialize configuration
ccc init
# List available providers
ccc list
# Switch provider
ccc qwen
ccc k2
ccc glm
# Add custom provider
ccc add my-provider https://api.example.com
# Show version
ccc version
# Show shell information (macOS/Linux)
ccc shell
The tool stores configuration in ~/.cc-switch-config
and updates shell configuration files:
- macOS/Linux:
~/.zshrc
or~/.bashrc
- Windows:
~/.zshrc
or~/.bashrc
(WSL)
Environment variables set:
ANTHROPIC_AUTH_TOKEN
ANTHROPIC_BASE_URL
ANTHROPIC_MODEL
(optional)
make build # Build for current platform
make build-macos-universal # Build universal macOS binary
make clean # Clean build artifacts
./unix/verify-install.sh # Verify installation
ccc list # Test basic functionality
ccc shell # Show shell information
ccc/
├── main.go # Core Go application
├── Makefile # Build configuration
├── CLAUDE.md # Developer documentation
├── README.md # User documentation
├── unix/ # Unix-specific scripts
│ ├── install-mac.sh
│ ├── install.sh
│ └── verify-install.sh
└── windows/ # Windows-specific scripts
├── install-user.sh
└── setup.sh
This project is licensed under the MIT License.