cc-provider-switcher 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -23
- package/dist/cli.js +44 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ npm install -g cc-provider-switcher@latest
|
|
|
49
49
|
|
|
50
50
|
ccs sets `ANTHROPIC_DEFAULT_*_MODEL_SUPPORTED_CAPABILITIES` so Claude Code knows which thinking features a provider supports. No extra steps needed after switching.
|
|
51
51
|
|
|
52
|
-
**Providers with effort control** (DeepSeek, GLM, Qwen, Kimi, StepFun):
|
|
52
|
+
**Providers with effort control** (DeepSeek, MiniMax, GLM, Qwen, Kimi, StepFun):
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
55
|
ccs deepseek
|
|
@@ -59,15 +59,7 @@ ccs deepseek
|
|
|
59
59
|
|
|
60
60
|
```sh
|
|
61
61
|
ccs glm
|
|
62
|
-
# Same, plus max_effort tier available
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**MiniMax — adaptive thinking:**
|
|
66
|
-
|
|
67
|
-
```sh
|
|
68
|
-
ccs minimax
|
|
69
|
-
# MiniMax decides when to think based on task complexity — nothing to configure
|
|
70
|
-
# Note shown: "Only adaptive/disabled thinking (enabled returns 400)"
|
|
62
|
+
# Same, plus max_effort tier available (also on MiniMax)
|
|
71
63
|
```
|
|
72
64
|
|
|
73
65
|
**Seed/Doubao — thinking on/off only:**
|
|
@@ -85,6 +77,7 @@ ccs seed
|
|
|
85
77
|
|---------|-------------|
|
|
86
78
|
| `ccs <provider> [region]` | Switch Claude Code to a provider (user-level) |
|
|
87
79
|
| `ccs project <provider> [region]` | Switch for current project only |
|
|
80
|
+
| `ccs <provider> --model <id>` | Use one model ID for sonnet/opus/haiku (also works with `project`) |
|
|
88
81
|
| `ccs list` | List all available providers |
|
|
89
82
|
| `ccs status` | Show current provider, model, and API key |
|
|
90
83
|
| `ccs config` | Interactive API key setup |
|
|
@@ -104,19 +97,19 @@ ccs seed
|
|
|
104
97
|
| Name | Key | Aliases | Thinking | Regions |
|
|
105
98
|
|------|-----|---------|----------|---------|
|
|
106
99
|
| DeepSeek | `deepseek` | `ds` | effort | global |
|
|
107
|
-
| MiniMax | `minimax` | `mm` |
|
|
100
|
+
| MiniMax | `minimax` | `mm` | effort | global, china |
|
|
108
101
|
| Kimi | `kimi` | `kimi2` | effort | global, china |
|
|
109
102
|
| Qwen | `qwen` | — | effort | global, china |
|
|
110
103
|
| GLM | `glm` | `glm5` | effort | global, china |
|
|
111
104
|
| Seed/Doubao | `seed` | `doubao` | on/off | global |
|
|
112
105
|
| StepFun | `stepfun` | `sf` | effort | global |
|
|
113
106
|
| OpenRouter | `openrouter` | `or` | passthrough | global |
|
|
107
|
+
| LM Studio | `lmstudio` | `lms` | — | local |
|
|
114
108
|
|
|
115
109
|
Claude (Anthropic) isn't a switchable provider — it's Claude Code's own native default. Run `ccs reset` to return to it.
|
|
116
110
|
|
|
117
111
|
**Thinking column:**
|
|
118
112
|
- `effort` — reasoning_effort levels (low/medium/high)
|
|
119
|
-
- `adaptive` — adaptive thinking only (`enabled` causes 400 on this provider)
|
|
120
113
|
- `on/off` — thinking enabled/disabled, no effort control
|
|
121
114
|
- `passthrough` — depends on the model routed through OpenRouter
|
|
122
115
|
|
|
@@ -126,14 +119,15 @@ When Claude Code picks haiku/sonnet/opus, ccs maps them to the actual model IDs
|
|
|
126
119
|
|
|
127
120
|
| Provider | Haiku | Sonnet | Opus |
|
|
128
121
|
|----------|-------|--------|------|
|
|
129
|
-
| DeepSeek | `deepseek-
|
|
130
|
-
| MiniMax | `MiniMax-M3` | `MiniMax-M3` | `MiniMax-M3` |
|
|
131
|
-
| Kimi | `kimi-k3` | `kimi-k3` | `kimi-k3` |
|
|
132
|
-
| Qwen | `qwen3.7-plus` | `qwen3.7-plus` | `qwen3.7-
|
|
133
|
-
| GLM | `glm-5.
|
|
122
|
+
| DeepSeek | `deepseek-flash` | `deepseek-flash` | `deepseek-flash` |
|
|
123
|
+
| MiniMax | `MiniMax-M3.1-Flash` | `MiniMax-M3.1-Flash` | `MiniMax-M3.1-Flash` |
|
|
124
|
+
| Kimi | `kimi-k3.1-pro-highspeed` | `kimi-k3.1-pro` | `kimi-k3.1-pro` |
|
|
125
|
+
| Qwen | `qwen3.7-plus` | `qwen3.7-plus` | `qwen3.7-plus` |
|
|
126
|
+
| GLM | `glm-5.3-flash` | `glm-5.3` | `glm-5.3` |
|
|
134
127
|
| Seed/Doubao | `ark-code-latest` | `ark-code-latest` | `ark-code-latest` |
|
|
135
128
|
| StepFun | `step-3.7-flash` | `step-3.7-flash` | `step-3.7-flash` |
|
|
136
|
-
| OpenRouter | `anthropic/claude-haiku-
|
|
129
|
+
| OpenRouter | `anthropic/claude-haiku-5.5` | `anthropic/claude-sonnet-5.5` | `anthropic/claude-opus-5.5` |
|
|
130
|
+
| LM Studio | `qwen/qwen3.8-27b` | `qwen/qwen3.8-27b` | `qwen/qwen3.8-27b` |
|
|
137
131
|
|
|
138
132
|
Override any ID via `providerOverrides` in `~/.ccs/config.json` — see [Override model IDs](#override-model-ids).
|
|
139
133
|
|
|
@@ -179,6 +173,29 @@ Update model IDs without waiting for a release:
|
|
|
179
173
|
}
|
|
180
174
|
```
|
|
181
175
|
|
|
176
|
+
### LM Studio
|
|
177
|
+
|
|
178
|
+
`ccs lmstudio` (alias `lms`) points Claude Code at `http://127.0.0.1:1234`. Start the LM Studio server first. No API key needed. To use another model, pass it with `--model`:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
ccs lmstudio --model my/model-id
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
To make it permanent, override all four model fields (overrides replace `models` as a whole):
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"providerOverrides": {
|
|
189
|
+
"lmstudio": {
|
|
190
|
+
"defaultModel": "my/model-id",
|
|
191
|
+
"models": { "sonnet": "my/model-id", "opus": "my/model-id", "haiku": "my/model-id" }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Use the "API Model Identifier" shown in LM Studio. Set the context length to 32k or more.
|
|
198
|
+
|
|
182
199
|
### What ccs writes
|
|
183
200
|
|
|
184
201
|
ccs modifies only the `env` block in Claude Code settings. It never touches other fields (permissions, hooks, etc.).
|
|
@@ -191,11 +208,11 @@ ccs modifies only the `env` block in Claude Code settings. It never touches othe
|
|
|
191
208
|
"env": {
|
|
192
209
|
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
|
|
193
210
|
"ANTHROPIC_AUTH_TOKEN": "sk-...",
|
|
194
|
-
"ANTHROPIC_MODEL": "deepseek-
|
|
195
|
-
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-
|
|
196
|
-
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-
|
|
197
|
-
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-
|
|
198
|
-
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-
|
|
211
|
+
"ANTHROPIC_MODEL": "deepseek-flash",
|
|
212
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-flash",
|
|
213
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-flash",
|
|
214
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-flash",
|
|
215
|
+
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-flash",
|
|
199
216
|
"ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking",
|
|
200
217
|
"ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking",
|
|
201
218
|
"ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking"
|
package/dist/cli.js
CHANGED
|
@@ -12,6 +12,7 @@ var ProviderSchema = z.object({
|
|
|
12
12
|
defaultModel: z.string(),
|
|
13
13
|
aliases: z.array(z.string()),
|
|
14
14
|
keyEnvVar: z.string(),
|
|
15
|
+
keyOptional: z.boolean().optional(),
|
|
15
16
|
models: z.object({
|
|
16
17
|
sonnet: z.string(),
|
|
17
18
|
opus: z.string(),
|
|
@@ -42,44 +43,44 @@ var providers_default = {
|
|
|
42
43
|
deepseek: {
|
|
43
44
|
name: "DeepSeek",
|
|
44
45
|
baseUrl: "https://api.deepseek.com/anthropic",
|
|
45
|
-
defaultModel: "deepseek-
|
|
46
|
+
defaultModel: "deepseek-flash",
|
|
46
47
|
aliases: ["ds"],
|
|
47
48
|
keyEnvVar: "DEEPSEEK_API_KEY",
|
|
48
|
-
models: { sonnet: "deepseek-
|
|
49
|
+
models: { sonnet: "deepseek-flash", opus: "deepseek-flash", haiku: "deepseek-flash" },
|
|
49
50
|
supportedCapabilities: ["effort", "thinking"],
|
|
50
51
|
thinkingNote: "budget_tokens ignored, uses reasoning_effort internally"
|
|
51
52
|
},
|
|
52
53
|
minimax: {
|
|
53
54
|
name: "MiniMax",
|
|
54
55
|
baseUrl: "https://api.minimax.io/anthropic",
|
|
55
|
-
defaultModel: "MiniMax-M3",
|
|
56
|
+
defaultModel: "MiniMax-M3.1-Flash",
|
|
56
57
|
aliases: ["mm"],
|
|
57
58
|
keyEnvVar: "MINIMAX_API_KEY",
|
|
58
59
|
regions: {
|
|
59
60
|
global: "https://api.minimax.io/anthropic",
|
|
60
61
|
china: "https://api.minimaxi.com/anthropic"
|
|
61
62
|
},
|
|
62
|
-
models: { sonnet: "MiniMax-M3", opus: "MiniMax-M3", haiku: "MiniMax-M3" },
|
|
63
|
-
supportedCapabilities: ["
|
|
64
|
-
thinkingNote: "
|
|
63
|
+
models: { sonnet: "MiniMax-M3.1-Flash", opus: "MiniMax-M3.1-Flash", haiku: "MiniMax-M3.1-Flash" },
|
|
64
|
+
supportedCapabilities: ["effort", "max_effort", "thinking"],
|
|
65
|
+
thinkingNote: "Always thinks (disabled returns 400). Effort: low/medium/high/xhigh/max"
|
|
65
66
|
},
|
|
66
67
|
kimi: {
|
|
67
68
|
name: "Kimi",
|
|
68
69
|
baseUrl: "https://api.moonshot.ai/anthropic",
|
|
69
|
-
defaultModel: "kimi-k3",
|
|
70
|
+
defaultModel: "kimi-k3.1-pro",
|
|
70
71
|
aliases: ["kimi2"],
|
|
71
72
|
keyEnvVar: "KIMI_API_KEY",
|
|
72
73
|
regions: {
|
|
73
74
|
global: "https://api.moonshot.ai/anthropic",
|
|
74
75
|
china: "https://api.moonshot.cn/anthropic"
|
|
75
76
|
},
|
|
76
|
-
models: { sonnet: "kimi-k3", opus: "kimi-k3", haiku: "kimi-k3" },
|
|
77
|
+
models: { sonnet: "kimi-k3.1-pro", opus: "kimi-k3.1-pro", haiku: "kimi-k3.1-pro-highspeed" },
|
|
77
78
|
supportedCapabilities: ["effort", "thinking"]
|
|
78
79
|
},
|
|
79
80
|
qwen: {
|
|
80
81
|
name: "Qwen",
|
|
81
82
|
baseUrl: "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
|
|
82
|
-
defaultModel: "qwen3.7-
|
|
83
|
+
defaultModel: "qwen3.7-plus",
|
|
83
84
|
aliases: [],
|
|
84
85
|
keyEnvVar: "QWEN_API_KEY",
|
|
85
86
|
regions: {
|
|
@@ -88,7 +89,7 @@ var providers_default = {
|
|
|
88
89
|
},
|
|
89
90
|
models: {
|
|
90
91
|
sonnet: "qwen3.7-plus",
|
|
91
|
-
opus: "qwen3.7-
|
|
92
|
+
opus: "qwen3.7-plus",
|
|
92
93
|
haiku: "qwen3.7-plus"
|
|
93
94
|
},
|
|
94
95
|
supportedCapabilities: ["effort", "thinking"],
|
|
@@ -97,16 +98,16 @@ var providers_default = {
|
|
|
97
98
|
glm: {
|
|
98
99
|
name: "GLM",
|
|
99
100
|
baseUrl: "https://api.z.ai/api/anthropic",
|
|
100
|
-
defaultModel: "glm-5.
|
|
101
|
+
defaultModel: "glm-5.3",
|
|
101
102
|
aliases: ["glm5"],
|
|
102
103
|
keyEnvVar: "GLM_API_KEY",
|
|
103
104
|
regions: {
|
|
104
105
|
global: "https://api.z.ai/api/anthropic",
|
|
105
106
|
china: "https://open.bigmodel.cn/api/anthropic"
|
|
106
107
|
},
|
|
107
|
-
models: { sonnet: "glm-5.
|
|
108
|
+
models: { sonnet: "glm-5.3", opus: "glm-5.3", haiku: "glm-5.3-flash" },
|
|
108
109
|
supportedCapabilities: ["effort", "max_effort", "thinking"],
|
|
109
|
-
thinkingNote: "
|
|
110
|
+
thinkingNote: "Always reasons (disabled fails). Effort: low/high/max"
|
|
110
111
|
},
|
|
111
112
|
seed: {
|
|
112
113
|
name: "Seed/Doubao",
|
|
@@ -124,7 +125,7 @@ var providers_default = {
|
|
|
124
125
|
},
|
|
125
126
|
stepfun: {
|
|
126
127
|
name: "StepFun",
|
|
127
|
-
baseUrl: "https://api.stepfun.ai
|
|
128
|
+
baseUrl: "https://api.stepfun.ai",
|
|
128
129
|
defaultModel: "step-3.7-flash",
|
|
129
130
|
aliases: ["sf"],
|
|
130
131
|
keyEnvVar: "STEPFUN_API_KEY",
|
|
@@ -139,14 +140,28 @@ var providers_default = {
|
|
|
139
140
|
openrouter: {
|
|
140
141
|
name: "OpenRouter",
|
|
141
142
|
baseUrl: "https://openrouter.ai/api",
|
|
142
|
-
defaultModel: "anthropic/claude-sonnet-5",
|
|
143
|
+
defaultModel: "anthropic/claude-sonnet-5.5",
|
|
143
144
|
aliases: ["or"],
|
|
144
145
|
keyEnvVar: "OPENROUTER_API_KEY",
|
|
145
146
|
models: {
|
|
146
|
-
sonnet: "anthropic/claude-sonnet-5",
|
|
147
|
-
opus: "anthropic/claude-opus-
|
|
148
|
-
haiku: "anthropic/claude-haiku-
|
|
147
|
+
sonnet: "anthropic/claude-sonnet-5.5",
|
|
148
|
+
opus: "anthropic/claude-opus-5.5",
|
|
149
|
+
haiku: "anthropic/claude-haiku-5.5"
|
|
149
150
|
}
|
|
151
|
+
},
|
|
152
|
+
lmstudio: {
|
|
153
|
+
name: "LM Studio",
|
|
154
|
+
baseUrl: "http://127.0.0.1:1234",
|
|
155
|
+
defaultModel: "qwen/qwen3.8-27b",
|
|
156
|
+
aliases: ["lms"],
|
|
157
|
+
keyEnvVar: "LMSTUDIO_API_KEY",
|
|
158
|
+
keyOptional: true,
|
|
159
|
+
models: {
|
|
160
|
+
sonnet: "qwen/qwen3.8-27b",
|
|
161
|
+
opus: "qwen/qwen3.8-27b",
|
|
162
|
+
haiku: "qwen/qwen3.8-27b"
|
|
163
|
+
},
|
|
164
|
+
thinkingNote: "Local model. Use --model <id> to pick another one"
|
|
150
165
|
}
|
|
151
166
|
}
|
|
152
167
|
};
|
|
@@ -185,6 +200,9 @@ function getApiKey(provider, userConfig) {
|
|
|
185
200
|
if (envVal) return envVal;
|
|
186
201
|
return userConfig?.keys?.[provider.registryKey] ?? null;
|
|
187
202
|
}
|
|
203
|
+
function withModel(provider, model) {
|
|
204
|
+
return { ...provider, defaultModel: model, models: { sonnet: model, opus: model, haiku: model } };
|
|
205
|
+
}
|
|
188
206
|
|
|
189
207
|
// src/config/user-config.ts
|
|
190
208
|
import readline from "readline";
|
|
@@ -364,16 +382,17 @@ function table(rows) {
|
|
|
364
382
|
|
|
365
383
|
// src/commands/switch.ts
|
|
366
384
|
var CLAUDE_NATIVE_NAMES = /* @__PURE__ */ new Set(["claude", "anthropic", "sonnet"]);
|
|
367
|
-
async function doSwitch(providerName, region, scope) {
|
|
385
|
+
async function doSwitch(providerName, region, scope, model) {
|
|
368
386
|
if (CLAUDE_NATIVE_NAMES.has(providerName.toLowerCase())) {
|
|
369
387
|
info("Claude is Claude Code's native default \u2014 there is nothing to switch to.");
|
|
370
388
|
info('Run "ccs reset" to clear provider overrides and return to it.');
|
|
371
389
|
return;
|
|
372
390
|
}
|
|
373
391
|
const userConfig = await loadUserConfig();
|
|
374
|
-
const
|
|
392
|
+
const resolved = resolveProvider(providerName, userConfig);
|
|
393
|
+
const provider = model ? withModel(resolved, model) : resolved;
|
|
375
394
|
const baseUrl = resolveBaseUrl(provider, region);
|
|
376
|
-
const apiKey = getApiKey(provider, userConfig);
|
|
395
|
+
const apiKey = getApiKey(provider, userConfig) ?? (provider.keyOptional ? provider.registryKey : null);
|
|
377
396
|
if (!apiKey) {
|
|
378
397
|
error(
|
|
379
398
|
`No API key for ${provider.name}. Set ${provider.keyEnvVar} or run "ccs config".`
|
|
@@ -406,11 +425,11 @@ async function doSwitch(providerName, region, scope) {
|
|
|
406
425
|
if (provider.thinkingNote) info(`Thinking: ${provider.thinkingNote}`);
|
|
407
426
|
}
|
|
408
427
|
function registerSwitchCommand(program2) {
|
|
409
|
-
program2.argument("<provider>", "Provider name or alias").argument("[region]", "Optional region (global, china, etc.)").action(async (provider, region) => {
|
|
410
|
-
await doSwitch(provider, region, "user");
|
|
428
|
+
program2.argument("<provider>", "Provider name or alias").argument("[region]", "Optional region (global, china, etc.)").option("-m, --model <id>", "Use this model ID for all of sonnet/opus/haiku").action(async (provider, region, opts) => {
|
|
429
|
+
await doSwitch(provider, region, "user", opts.model);
|
|
411
430
|
});
|
|
412
|
-
program2.command("project <provider> [region]").description("Switch provider for current project only").action(async (provider, region) => {
|
|
413
|
-
await doSwitch(provider, region, "project");
|
|
431
|
+
program2.command("project <provider> [region]").description("Switch provider for current project only").option("-m, --model <id>", "Use this model ID for all of sonnet/opus/haiku").action(async (provider, region, opts) => {
|
|
432
|
+
await doSwitch(provider, region, "project", opts.model);
|
|
414
433
|
});
|
|
415
434
|
}
|
|
416
435
|
|