@jjuidev/cs
v0.0.6
Published
cs (claude switch) is helper CLI to switch claude code provider
Maintainers
Readme
@jjuidev/cs
cs (claude switch) - CLI tool for switching between different Claude API providers.
Features
- 🔧 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> - 📊 Provider Listing: View all configured providers and their settings
Quick Start
# Install the CLI
npm install -g @jjuidev/cs
# Or with other package managers
yarn global add @jjuidev/cs
pnpm add -g @jjuidev/csCommands
cs <provider> - Switch to Provider
Switch to a configured provider immediately.
# Switch to official Claude
cs claude
# Switch to z provider
cs z
# Switch to Claudible
cs claudible
# Switch to jjuidev
cs jjuidev
# Switch to Kimi
cs kimi
# Switch to MiniMax
cs minimaxcs config -p <provider> - Configure Provider
Configure provider settings including tokens, URLs, and models.
# 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/anthropic
# Set specific models
cs config -p claude -o claude-opus-4.5 -s claude-sonnet-4.5 -h claude-haiku-4.5
# Configure Kimi provider
cs config -p kimi -t sk-ant-api03-your-token
# Load default configuration
cs config -p claudeOptions:
-p, --provider <provider>- Provider name (required)-t, --token <token>- Authentication token-u, --url <url>- Custom base URL-o, --opus <model>- Opus model name-s, --sonnet <model>- Sonnet model name-h, --haiku <model>- Haiku model name
cs list - List Providers
List all available providers and their current configurations.
cs list
# or
cs lsOutput:
→ 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: claudecs current - Show Current Provider
Display the currently active provider.
cs currentSupported 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
Storage Location
Configuration is stored in ~/.cs/settings.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"
}Claude Code Integration
The CLI automatically updates ~/.claude/settings.json for Claude Code integration:
{
"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"
}
}Shell Integration
The CLI automatically updates your shell configuration file (.zshrc, .bashrc, or .config/fish/config.fish):
# cs marker - do not edit
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
export ANTHROPIC_AUTH_TOKEN="sk-ant-api03-..."
# cs end markerAfter switching providers, run source ~/.zshrc (or your shell equivalent) or restart your shell.
Usage Examples
Complete Setup Flow
- Install the CLI
npm install -g @jjuidev/cs- Configure a provider
# Set up Claude provider
cs config -p claude -t sk-ant-api03-your-token-here
# Set up z provider
cs config -p z -t sk-ant-api03-another-token -u https://api.z.ai/api/anthropic- List providers to verify
cs list- Switch providers
# Switch to Claude
cs claude
# Switch to z
cs zWorking with Multiple Providers
# 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.1
# View all configurations
cs list
# Quickly 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 MiniMaxTroubleshooting
Common Issues
Provider not found
cs invalid-provider
# Error: Invalid provider: invalid-provider
# Info: Valid providers: claude, claudible, jjuidev, kimi, z, minimaxMissing token
cs z
# Warning: No auth token set for provider "z"
# Info: Set token with: cs config -p z -t <your-token>Shell integration not working
# After switching providers, restart your shell or run:
source ~/.zshrc # for zsh
source ~/.bashrc # for bashDebug Mode
Enable debug logging for troubleshooting:
# Set debug environment variable
export DEBUG=cs:*
# Run commands with debug output
cs list
cs currentDevelopment
Building from Source
# Clone the repository
git clone https://github.com/jjuidev/cs.git
cd cs
# Install dependencies
npm install
# Build the project
npm run build
# Test the build
node dist/cli/cs-cli.cjs --helpProject Structure
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 pointContributing
We welcome contributions! Please see our Contributing Guidelines for details.
Quick Start for Contributors
# Make your changes
npm run build
# Test your changes
npm install -g .
cs --help
# Create a changeset
npm run changeset
# Commit your changes
git commit -m "feat: your feature"Changelog
See CHANGELOG.md for release history.
License
MIT
Author
jjuidev [email protected]
