@sunday-sky/cc-switcher
v1.2.3
Published
CLI for switching Claude Code providers and models
Maintainers
Readme
cc-switcher
cc-switcher is a Bun-first TypeScript CLI for managing Claude Code provider profiles and default models.
It is built for people who keep Claude Code configs in ~/.claude/settings.json and ~/.claude/settings.<profile>.json, and want a faster way to:
- switch between saved provider profiles
- see the active profile, model, and base URL
- discover available OpenRouter models
- update a profile's default model without editing JSON by hand
The CLI is available as both cc-switcher and ccs.
Quick Start
If you only want the shortest path from install to use, follow this order:
- Install the CLI
- Check which profiles exist
- Inspect the active profile
- Switch to the profile you want
- Update or pick a model
Install
From npm
npm install -g @sunday-sky/cc-switcherLocal development
Requirements:
- Bun
>= 1.2.16
bun install
bun linkFirst Run
1. See your saved profiles
ccs profiles
ccs profiles --jsonThis lists profiles discovered from ~/.claude/settings.<name>.json.
The active profile is marked with *.
2. Check what is active right now
ccs current
ccs current --jsonThis shows:
- the active profile name
- the current model
- the configured base URL
3. Switch to another profile
ccs switch openrouter
ccs switch local-gateway
ccs switchIf you omit the profile, ccs switch opens a searchable selector.
In non-standard terminals or wrapped shells, the selector falls back to a simpler prompt to avoid noisy redraw output.
4. Update the model for the active profile
ccs use -m anthropic/claude-sonnet-4.6
ccs use anthropic/claude-sonnet-4.6 --jsonIf you omit the model, ccs use opens an interactive vendor-and-model picker.
It uses a searchable terminal UI when available, and falls back to a simpler prompt in terminals that do not behave well with advanced redraw output.
For profiles that do not support model discovery, pass the model directly with ccs use -m <model>.
5. Pick a profile and model in one flow
ccs pick
ccs pick --vendor anthropic
ccs pick --vendor openaipick first switches the profile, then updates the model if the selected profile supports model discovery.
For OpenRouter-backed profiles, the CLI can first ask you to choose a vendor and then narrow the model list to that vendor.
Common Workflows
Check available OpenRouter models
ccs models
ccs models --jsonTo inspect a different profile:
ccs models openrouter
ccs models openrouter anthropic
ccs models openrouter openai
ccs models openrouter anthropic --jsonModel discovery works when ANTHROPIC_BASE_URL contains openrouter.ai.
Create a new profile
ccs create openrouter \
--base-url https://openrouter.ai/api \
--api-key sk-or-v1-your-key \
--model anthropic/claude-sonnet-4.6If you skip flags, create prompts for the missing values:
ccs create openrouterIf a profile with the same name already exists, create will ask whether you want to overwrite it or choose a new name.
Edit an existing profile
ccs edit openrouter --model openai/gpt-5-codex
ccs edit openrouter --model openai/gpt-5-codex --jsonIf you run ccs edit openrouter without flags, the CLI prompts for the current base URL, API key, and default model.
Rename a profile
ccs rename openrouter openrouter-v2
ccs rename openrouter openrouter-v2 --jsonIf the target profile name already exists, rename will ask whether you want to overwrite it or choose a new name.
Delete a profile
ccs delete openrouter
ccs delete openrouter --jsonFor safety, the CLI refuses to delete the currently active profile.
Command Reference
profiles
List saved Claude profiles. Pass a profile name to show only that profile's details.
ccs profiles
ccs profiles quotio
ccs profiles --json
ccs profiles quotio --jsoncurrent
Show the active profile, model, and base URL.
ccs current
ccs current --jsonswitch [profile]
Switch to a saved Claude profile.
ccs switch
ccs switch openrouter
ccs switch openrouter --jsonpick
Interactively choose a profile and model.
ccs pick
ccs pick --vendor anthropicmodels [profile] [vendor]
List models for a provider-backed profile.
ccs models
ccs models openrouter
ccs models openrouter anthropic
ccs models openrouter anthropic --jsonuse [model]
Set the default model for the active profile, or for a profile passed with --profile.
ccs use
ccs use anthropic/claude-sonnet-4.6
ccs use -m openai/gpt-5-codex --profile openrouter
ccs use openai/gpt-5-codex --profile openrouter --jsoncreate <profile>
Create a Claude profile.
ccs create openrouter
ccs create openrouter \
--base-url https://openrouter.ai/api \
--api-key sk-or-v1-your-key \
--model anthropic/claude-sonnet-4.6 \
--jsonedit <profile>
Edit a saved profile.
ccs edit openrouter
ccs edit openrouter --model anthropic/claude-sonnet-4.6
ccs edit openrouter --model anthropic/claude-sonnet-4.6 --jsonrename <profile> <next-profile>
Rename a saved profile.
ccs rename openrouter openrouter-v2
ccs rename openrouter openrouter-v2 --jsonIf the target name already exists, rename asks whether to overwrite it or pick another name.
delete <profile>
Delete a saved profile.
ccs delete openrouter
ccs delete openrouter --jsonHow It Works
Profiles are discovered from:
~/.claude/settings.<name>.json
The active Claude Code config is:
~/.claude/settings.json
When you run ccs switch <profile>, the tool merges the selected profile into settings.json while preserving unrelated user settings such as enabled plugins.
When you run ccs use <model> or ccs use -m <model>, the tool updates:
modelenv.ANTHROPIC_MODELenv.ANTHROPIC_DEFAULT_OPUS_MODELenv.ANTHROPIC_DEFAULT_SONNET_MODELenv.ANTHROPIC_DEFAULT_HAIKU_MODELenv.ANTHROPIC_SMALL_FAST_MODEL
If the target profile is active, settings.json is updated too.
JSON Output
These commands support --json:
ccs profiles --jsonccs current --jsonccs models [profile] [vendor] --jsonccs switch <profile> --jsonccs use <model> [--profile <name>] --jsonccs use -m <model> [--profile <name>] --jsonccs create <profile> --jsonccs edit <profile> --jsonccs delete <profile> --json
This makes it easier to script around the CLI from shell pipelines or automation.
Provider Support
OpenRouter
cc-switcher currently supports model discovery for OpenRouter-backed profiles by calling:
https://openrouter.ai/api/v1/models
Profiles are treated as OpenRouter profiles when ANTHROPIC_BASE_URL contains openrouter.ai.
Other providers
Other profiles can still be switched and updated manually with ccs use -m <model>, but remote model discovery is not implemented yet.
Respectful Attribution
This project was inspired by foreveryh/claude-code-switch, which showed a clean, profile-oriented workflow for Claude Code switching.
cc-switcher does not copy that project’s shell implementation. Instead, it reimplements the idea as a Bun + TypeScript CLI and extends it with model discovery and model switching, especially for OpenRouter-backed setups.
If you primarily want a lightweight shell-based switcher, you should also take a look at the original project.
Development
Run tests:
bun testRun type-checking:
bun run typecheckBuild the publishable CLI:
bun run buildThe build output is written to:
dist/bin/cc-switcher.jsShow CLI help during development:
bun run src/cli.ts --helpThe help output includes examples and notes for the most common profile and model workflows.
Publishing
Before publishing, the package runs:
bun run typecheck
bun test
bun run buildThis happens automatically through prepublishOnly, so the published package uses the built file from dist/.
