cs (claude switch) is helper CLI to switch claude code provider
npm install @jjuidev/cscs (claude switch) - CLI tool for switching between different Claude API providers.
- š§ Provider Management: Switch between Claude, Claudible, jjuidev, Kimi, and z providers
- š Configuration Management: Configure tokens, URLs, and models for each provider
- š„ļø Shell Integration: Automatically exports environment variables to your shell
- šÆ Quick Switching: Instant provider switching with cs
- š Provider Listing: View all configured providers and their settings
``bashInstall the CLI
npm install -g @jjuidev/cs
Commands
$3
Switch to a configured provider immediately.
`bash
Switch to official Claude
cs claudeSwitch to z provider
cs zSwitch to Claudible
cs claudibleSwitch to jjuidev
cs jjuidevSwitch to Kimi
cs kimiSwitch to MiniMax
cs minimax
`$3
Configure provider settings including tokens, URLs, and models.
`bash
Set authentication token
cs config -p claude -t sk-ant-api03-...Set custom base URL
cs config -p z -u https://api.z.ai/api/anthropicSet specific models
cs config -p claude -o claude-opus-4.5 -s claude-sonnet-4.5 -h claude-haiku-4.5Configure Kimi provider
cs config -p kimi -t sk-ant-api03-your-tokenLoad default configuration
cs config -p claude
`Options:
-
-p, --provider - Provider name (required)
- -t, --token - Authentication token
- -u, --url - Custom base URL
- -o, --opus - Opus model name
- -s, --sonnet - Sonnet model name
- -h, --haiku - Haiku model name$3
List all available providers and their current configurations.
`bash
cs list
or
cs ls
`Output:
`
ā claude:
URL: https://api.anthropic.com
Token: sk-ant-**1234
Opus: claude-opus-4.5
Sonnet: claude-sonnet-4.5
Haiku: claude-haiku-4.5 z:
URL: https://api.z.ai/api/anthropic
Token: not set
Opus: GLM-4.7
Sonnet: GLM-4.7
Haiku: GLM-4.5-Air
Current provider: claude
`$3
Display the currently active provider.
`bash
cs current
`$3
Update cs CLI to a newer version with three convenient modes.
`bash
Update to latest version
cs updateInteractive version selection (shows 10 newest versions)
cs update list
cs update lsUpdate to specific version
cs update 0.0.3
`Features:
- ā
Auto-update to latest stable version
- ā
Interactive version selection with @clack/prompts
- ā
Specific version installation
- ā
Automatic rollback on failure
- ā
Installation verification
Supported Providers
| Provider | Base URL | Default Models |
| --------- | ------------------------------ | -------------------------------------------------------------------------------------------- |
| claude | https://api.anthropic.com | claude-opus-4.5, claude-sonnet-4.5, claude-haiku-4.5 |
| claudible | https://claudible.io | claude-opus-4.5, claude-sonnet-4.5, claude-haiku-4.5 |
| jjuidev | https://ai.jjuidev.com | gemini-claude-opus-4-5-thinking, gemini-claude-sonnet-4-5-thinking, gemini-claude-sonnet-4-5 |
| kimi | https://api.kimi.com/coding | kimi-k2.5, kimi-k2.5, kimi-k2.5 |
| z | https://api.z.ai/api/anthropic | GLM-4.7, GLM-4.7, GLM-4.5-Air |
| minimax | https://api.minimax.io/anthropic | MiniMax-M2.1, MiniMax-M2.1, MiniMax-M2.1 |
Configuration
$3
Configuration is stored in
~/.cs/settings.json:`json
{
"providers": {
"claude": {
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
"ANTHROPIC_AUTH_TOKEN": "sk-ant-api03-...",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5"
},
"kimi": {
"ANTHROPIC_BASE_URL": "https://api.kimi.com/coding",
"ANTHROPIC_AUTH_TOKEN": "",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k2.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k2.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-k2.5"
},
"z": {
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "GLM-4.7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "GLM-4.7",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "GLM-4.5-Air"
}
},
"current": "claude"
}
`$3
The CLI automatically updates
~/.claude/settings.json for Claude Code integration:`json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
"ANTHROPIC_AUTH_TOKEN": "sk-ant-api03-...",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5"
}
}
`$3
The CLI automatically updates your shell configuration file (
.zshrc, .bashrc, or .config/fish/config.fish):`bash
cs marker - do not edit
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
export ANTHROPIC_AUTH_TOKEN="sk-ant-api03-..."
cs end marker
`After switching providers, run
source ~/.zshrc (or your shell equivalent) or restart your shell.Usage Examples
$3
1. Install the CLI
`bash
npm install -g @jjuidev/cs
`2. Configure a provider
`bash
Set up Claude provider
cs config -p claude -t sk-ant-api03-your-token-hereSet up z provider
cs config -p z -t sk-ant-api03-another-token -u https://api.z.ai/api/anthropic
`3. List providers to verify
`bash
cs list
`4. Switch providers
`bash
Switch to Claude
cs claudeSwitch to z
cs z
`$3
`bash
Configure multiple providers
cs config -p claude -t sk-ant-api03-... -o claude-opus-4.5
cs config -p claudible -t sk-ant-api03-... -o claude-sonnet-4.5
cs config -p jjuidev -t sk-ant-api03-... -o gemini-claude-opus-4-5-thinking
cs config -p kimi -t sk-ant-api03-... -o kimi-k2.5
cs config -p minimax -t sk-ant-api03-... -o MiniMax-M2.1View all configurations
cs listQuickly switch between them
cs claude # Use Claude
cs jjuidev # Switch to jjuidev
cs claudible # Switch to Claudible
cs kimi # Switch to Kimi
cs minimax # Switch to MiniMax
`Troubleshooting
$3
Provider not found
`bash
cs invalid-provider
Error: Invalid provider: invalid-provider
Info: Valid providers: claude, claudible, jjuidev, kimi, z, minimax
`Missing token
`bash
cs z
Warning: No auth token set for provider "z"
Info: Set token with: cs config -p z -t
`Shell integration not working
`bash
After switching providers, restart your shell or run:
source ~/.zshrc # for zsh
source ~/.bashrc # for bash
`$3
Enable debug logging for troubleshooting:
`bash
Set debug environment variable
export DEBUG=cs:*Run commands with debug output
cs list
cs current
`Development
$3
`bash
Clone the repository
git clone https://github.com/jjuidev/cs.git
cd csInstall dependencies
npm installBuild the project
npm run buildTest the build
node dist/cli/cs-cli.cjs --help
`$3
`
src/
āāā cli/ # CLI interface
ā āāā actions/ # Command handlers
ā āāā cs-cli.ts # Main entry point
āāā config/ # Configuration management
āāā shell/ # Shell integration
āāā types/ # TypeScript types
āāā index.ts # Library entry point
`Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
$3
`bash
Make your changes
npm run buildTest your changes
npm install -g .
cs --helpCreate a changeset
npm run changesetCommit your changes
git commit -m "feat: your feature"
``See CHANGELOG.md for release history.
MIT
jjuidev