CLI tool to switch Claude Code custom API configurations
npm install sc-claude
π¨π³ δΈζ | πΊπΈ English
Features β’
Installation β’
Quick Start β’
Commands β’
How It Works
---
``/ / / / __ / _ \
____ _ __ __ ________ __
/ __/ __(_) /______/ /_ / ____/ /___ ___ ______/ /__
\__ \ | /| / / / __/ ___/ __ \ / / / / __
___/ / |/ |/ / / /_/ /__/ / / / / /___/ / /_/ / /_/ / /_/ / __/
/____/|__/|__/_/\__/\___/_/ /_/ \____/_/\__,_/\__,_/\__,_/\___/
$ sc
? Select API profile to switch to:
βΆ production (current)
development
local-proxy
``
---
- π One Command Switch - Switch API configurations instantly with sc
- π Multiple Profiles - Manage unlimited API configurations
- π― Auto Detection - Automatically imports your existing environment variables
- β‘ Tab Completion - Shell auto-completion out of the box
- π₯οΈ Cross Platform - Works on macOS, Linux, and Windows
`bash`
npm install -g sc-claude
That's it! The CLI will:
- β
Auto-detect your current ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL
- β
Create a default profile from your existing config
- β
Install shell completions for zsh/bash
`bashInteractive switch (shows all profiles)
sc
π Commands
| Command | Description |
|---------|-------------|
|
sc | Interactive profile selector |
| sc use | Quick switch to a profile |
| sc add | Add a new profile |
| sc edit | Edit an existing profile |
| sc remove | Remove a profile |
| sc list | List all profiles |
| sc env | Output current profile as export statements |$3
Adding a new profile:
`bash
$ sc add
? Profile name: my-custom-api
? ANTHROPIC_AUTH_TOKEN: sk-ant-xxx...
? ANTHROPIC_BASE_URL: https://my-proxy.com/apiβ Profile "my-custom-api" added successfully
`Listing profiles:
`bash
$ sc listAPI Profiles:
βΆ production (current)
code.example.com/api
development
dev.example.com/api
local
127.0.0.1:8080
`Switching profiles:
`bash
$ sc use developmentβ Switched to development
π‘ Run the following command to apply changes immediately:
eval "$(sc env)"
`βοΈ How It Works
Switch Claude manages your API configurations in
~/.claude/sc-profiles.json and updates your shell configuration file (~/.zshrc or ~/.bashrc) with the active profile's environment variables.`
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
β sc-profiles.json β βββΆ β Shell Config β βββΆ β Claude Code β
β (your profiles) β β (env exports) β β (uses API) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ
`$3
| File | Path | Description |
|------|------|-------------|
| Profiles |
~/.claude/sc-profiles.json | All your API configurations |
| Shell exports | ~/.zshrc or ~/.bashrc | Environment variables (managed block) |π§ Shell Completion
Tab completion is automatically installed. Just type:
`bash
sc
Shows: use add remove edit list env
``- Multiple API Keys - Switch between personal and work accounts
- Custom Proxies - Toggle between direct API and proxy endpoints
- Development/Production - Separate configs for different environments
- API Testing - Quick switch for debugging different endpoints
MIT Β© 2024
---
Made with β€οΈ for the Claude Code community