cc-provider-switcher 0.1.0 → 0.2.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 +86 -29
- package/dist/cli.js +72 -34
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -37,6 +37,40 @@ npx cc-provider-switcher deepseek
|
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
+
## Thinking & effort support
|
|
41
|
+
|
|
42
|
+
ccs sets `ANTHROPIC_DEFAULT_*_MODEL_SUPPORTED_CAPABILITIES` so Claude Code knows which thinking features a provider supports. No extra steps needed after switching.
|
|
43
|
+
|
|
44
|
+
**Providers with effort control** (DeepSeek, GLM, Qwen, Kimi, StepFun):
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
ccs deepseek
|
|
48
|
+
# Claude Code now exposes /effort controls (low / medium / high)
|
|
49
|
+
# Use /effort high inside Claude Code — DeepSeek maps it to reasoning_effort internally
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
ccs glm
|
|
54
|
+
# Same, plus max_effort tier available
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**MiniMax — adaptive thinking:**
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
ccs minimax
|
|
61
|
+
# MiniMax decides when to think based on task complexity — nothing to configure
|
|
62
|
+
# Note shown: "Only adaptive/disabled thinking (enabled returns 400)"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Seed/Doubao — thinking on/off only:**
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
ccs seed
|
|
69
|
+
# Thinking is either on or off, no granular effort control
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
40
74
|
## Commands
|
|
41
75
|
|
|
42
76
|
| Command | Description |
|
|
@@ -59,17 +93,42 @@ npx cc-provider-switcher deepseek
|
|
|
59
93
|
|
|
60
94
|
## Providers
|
|
61
95
|
|
|
62
|
-
| Name | Key | Aliases | Regions |
|
|
63
|
-
|
|
64
|
-
| DeepSeek | `deepseek` | `ds` | global |
|
|
65
|
-
| MiniMax | `minimax` | `mm` | global, china |
|
|
66
|
-
| Kimi | `kimi` | `kimi2` | global, china |
|
|
67
|
-
| Qwen | `qwen` | — | global, china |
|
|
68
|
-
| GLM | `glm` | `glm5` | global, china |
|
|
69
|
-
| Seed/Doubao | `seed` | `doubao` | global |
|
|
70
|
-
| StepFun | `stepfun` | `sf` | global |
|
|
71
|
-
| OpenRouter | `openrouter` | `or` | global |
|
|
72
|
-
| Claude (Anthropic) | `claude` | `anthropic`, `sonnet` | global |
|
|
96
|
+
| Name | Key | Aliases | Thinking | Regions |
|
|
97
|
+
|------|-----|---------|----------|---------|
|
|
98
|
+
| DeepSeek | `deepseek` | `ds` | effort | global |
|
|
99
|
+
| MiniMax | `minimax` | `mm` | adaptive | global, china |
|
|
100
|
+
| Kimi | `kimi` | `kimi2` | effort | global, china |
|
|
101
|
+
| Qwen | `qwen` | — | effort | global, china |
|
|
102
|
+
| GLM | `glm` | `glm5` | effort | global, china |
|
|
103
|
+
| Seed/Doubao | `seed` | `doubao` | on/off | global |
|
|
104
|
+
| StepFun | `stepfun` | `sf` | effort | global |
|
|
105
|
+
| OpenRouter | `openrouter` | `or` | passthrough | global |
|
|
106
|
+
| Claude (Anthropic) | `claude` | `anthropic`, `sonnet` | native | global |
|
|
107
|
+
|
|
108
|
+
**Thinking column:**
|
|
109
|
+
- `effort` — reasoning_effort levels (low/medium/high)
|
|
110
|
+
- `adaptive` — adaptive thinking only (`enabled` causes 400 on this provider)
|
|
111
|
+
- `on/off` — thinking enabled/disabled, no effort control
|
|
112
|
+
- `native` — Claude Code's built-in detection applies
|
|
113
|
+
- `passthrough` — depends on the model routed through OpenRouter
|
|
114
|
+
|
|
115
|
+
### Model mapping
|
|
116
|
+
|
|
117
|
+
When Claude Code picks haiku/sonnet/opus, ccs maps them to the actual model IDs below:
|
|
118
|
+
|
|
119
|
+
| Provider | Haiku | Sonnet | Opus |
|
|
120
|
+
|----------|-------|--------|------|
|
|
121
|
+
| DeepSeek | `deepseek-v4-flash` | `deepseek-v4-flash` | `deepseek-v4-pro` |
|
|
122
|
+
| MiniMax | `MiniMax-M3` | `MiniMax-M3` | `MiniMax-M3` |
|
|
123
|
+
| Kimi | `kimi-k2.7-code-highspeed` | `kimi-k2.7-code-highspeed` | `kimi-k2.7-code` |
|
|
124
|
+
| Qwen | `qwen3.7-plus` | `qwen3.7-plus` | `qwen3.7-max` |
|
|
125
|
+
| GLM | `glm-5.2` | `glm-5.2` | `glm-5.2` |
|
|
126
|
+
| Seed/Doubao | `ark-code-latest` | `ark-code-latest` | `ark-code-latest` |
|
|
127
|
+
| StepFun | `step-3.7-flash` | `step-3.7-flash` | `step-3.7-flash` |
|
|
128
|
+
| OpenRouter | `anthropic/claude-haiku-4.5` | `anthropic/claude-sonnet-4.6` | `anthropic/claude-opus-4.8` |
|
|
129
|
+
| Claude (Anthropic) | `claude-haiku-4-5-20251001` | `claude-sonnet-4-6` | `claude-opus-4-8` |
|
|
130
|
+
|
|
131
|
+
Override any ID via `providerOverrides` in `~/.ccs/config.json` — see [Override model IDs](#override-model-ids).
|
|
73
132
|
|
|
74
133
|
---
|
|
75
134
|
|
|
@@ -125,11 +184,14 @@ ccs modifies only the `env` block in Claude Code settings. It never touches othe
|
|
|
125
184
|
"env": {
|
|
126
185
|
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
|
|
127
186
|
"ANTHROPIC_AUTH_TOKEN": "sk-...",
|
|
128
|
-
"ANTHROPIC_MODEL": "deepseek-
|
|
129
|
-
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-
|
|
130
|
-
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-
|
|
131
|
-
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-
|
|
132
|
-
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-
|
|
187
|
+
"ANTHROPIC_MODEL": "deepseek-v4-flash",
|
|
188
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-flash",
|
|
189
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro",
|
|
190
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash",
|
|
191
|
+
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash",
|
|
192
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking",
|
|
193
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking",
|
|
194
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES": "effort,thinking"
|
|
133
195
|
},
|
|
134
196
|
"ccsManaged": true
|
|
135
197
|
}
|
|
@@ -169,23 +231,18 @@ Add an entry to `src/providers/providers.json` and submit a PR:
|
|
|
169
231
|
"sonnet": "my-model-v1",
|
|
170
232
|
"opus": "my-model-v1",
|
|
171
233
|
"haiku": "my-model-v1"
|
|
172
|
-
}
|
|
234
|
+
},
|
|
235
|
+
"supportedCapabilities": ["effort", "thinking"],
|
|
236
|
+
"thinkingNote": "Optional note shown after ccs switch"
|
|
173
237
|
}
|
|
174
238
|
}
|
|
175
239
|
```
|
|
176
240
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|--|--|--|
|
|
183
|
-
| Distribution | npm (no install script) | bash script |
|
|
184
|
-
| Provider definitions | JSON registry | hardcoded functions |
|
|
185
|
-
| Adding providers | JSON entry | copy-paste bash function |
|
|
186
|
-
| Model IDs | User-overridable | Hardcoded |
|
|
187
|
-
| Tests | Vitest suite | None |
|
|
188
|
-
| Settings method | Direct `settings.json` write | `eval` + env vars |
|
|
241
|
+
**Optional fields:**
|
|
242
|
+
- `supportedCapabilities` — Claude Code capability strings to declare (`effort`, `thinking`, `adaptive_thinking`, `max_effort`). Sets `ANTHROPIC_DEFAULT_*_MODEL_SUPPORTED_CAPABILITIES` env vars so Claude Code enables effort/thinking controls.
|
|
243
|
+
- `thinkingNote` — shown as an info line after switching, to warn about provider-specific limits.
|
|
244
|
+
- `regions` — map of region name → base URL.
|
|
245
|
+
- `optional` — if `true`, missing API key is not a fatal error (used for Claude native).
|
|
189
246
|
|
|
190
247
|
---
|
|
191
248
|
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,9 @@ var ProviderSchema = z.object({
|
|
|
17
17
|
haiku: z.string()
|
|
18
18
|
}),
|
|
19
19
|
regions: z.record(z.string(), z.string()).optional(),
|
|
20
|
-
optional: z.boolean().optional()
|
|
20
|
+
optional: z.boolean().optional(),
|
|
21
|
+
supportedCapabilities: z.array(z.string()).optional(),
|
|
22
|
+
thinkingNote: z.string().optional()
|
|
21
23
|
});
|
|
22
24
|
var ProviderRegistrySchema = z.object({
|
|
23
25
|
providers: z.record(z.string(), ProviderSchema)
|
|
@@ -40,52 +42,57 @@ var providers_default = {
|
|
|
40
42
|
deepseek: {
|
|
41
43
|
name: "DeepSeek",
|
|
42
44
|
baseUrl: "https://api.deepseek.com/anthropic",
|
|
43
|
-
defaultModel: "deepseek-
|
|
45
|
+
defaultModel: "deepseek-v4-flash",
|
|
44
46
|
aliases: ["ds"],
|
|
45
47
|
keyEnvVar: "DEEPSEEK_API_KEY",
|
|
46
|
-
models: { sonnet: "deepseek-
|
|
48
|
+
models: { sonnet: "deepseek-v4-flash", opus: "deepseek-v4-pro", haiku: "deepseek-v4-flash" },
|
|
49
|
+
supportedCapabilities: ["effort", "thinking"],
|
|
50
|
+
thinkingNote: "budget_tokens ignored, uses reasoning_effort internally"
|
|
47
51
|
},
|
|
48
52
|
minimax: {
|
|
49
53
|
name: "MiniMax",
|
|
50
54
|
baseUrl: "https://api.minimax.io/anthropic",
|
|
51
|
-
defaultModel: "MiniMax-
|
|
55
|
+
defaultModel: "MiniMax-M3",
|
|
52
56
|
aliases: ["mm"],
|
|
53
57
|
keyEnvVar: "MINIMAX_API_KEY",
|
|
54
58
|
regions: {
|
|
55
59
|
global: "https://api.minimax.io/anthropic",
|
|
56
60
|
china: "https://api.minimaxi.com/anthropic"
|
|
57
61
|
},
|
|
58
|
-
models: { sonnet: "MiniMax-
|
|
62
|
+
models: { sonnet: "MiniMax-M3", opus: "MiniMax-M3", haiku: "MiniMax-M3" },
|
|
63
|
+
supportedCapabilities: ["adaptive_thinking"],
|
|
64
|
+
thinkingNote: "Only adaptive/disabled thinking (enabled returns 400)"
|
|
59
65
|
},
|
|
60
66
|
claude: {
|
|
61
67
|
name: "Claude (Anthropic)",
|
|
62
68
|
baseUrl: "https://api.anthropic.com/",
|
|
63
|
-
defaultModel: "claude-sonnet-4-
|
|
69
|
+
defaultModel: "claude-sonnet-4-6",
|
|
64
70
|
aliases: ["anthropic", "sonnet"],
|
|
65
71
|
keyEnvVar: "CLAUDE_API_KEY",
|
|
66
72
|
optional: true,
|
|
67
73
|
models: {
|
|
68
|
-
sonnet: "claude-sonnet-4-
|
|
69
|
-
opus: "claude-opus-4-
|
|
74
|
+
sonnet: "claude-sonnet-4-6",
|
|
75
|
+
opus: "claude-opus-4-8",
|
|
70
76
|
haiku: "claude-haiku-4-5-20251001"
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
kimi: {
|
|
74
80
|
name: "Kimi",
|
|
75
81
|
baseUrl: "https://api.moonshot.ai/anthropic",
|
|
76
|
-
defaultModel: "kimi-k2.
|
|
82
|
+
defaultModel: "kimi-k2.7-code",
|
|
77
83
|
aliases: ["kimi2"],
|
|
78
84
|
keyEnvVar: "KIMI_API_KEY",
|
|
79
85
|
regions: {
|
|
80
86
|
global: "https://api.moonshot.ai/anthropic",
|
|
81
87
|
china: "https://api.moonshot.cn/anthropic"
|
|
82
88
|
},
|
|
83
|
-
models: { sonnet: "kimi-k2.
|
|
89
|
+
models: { sonnet: "kimi-k2.7-code-highspeed", opus: "kimi-k2.7-code", haiku: "kimi-k2.7-code-highspeed" },
|
|
90
|
+
supportedCapabilities: ["effort", "thinking"]
|
|
84
91
|
},
|
|
85
92
|
qwen: {
|
|
86
93
|
name: "Qwen",
|
|
87
94
|
baseUrl: "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
|
|
88
|
-
defaultModel: "qwen3-max
|
|
95
|
+
defaultModel: "qwen3.7-max",
|
|
89
96
|
aliases: [],
|
|
90
97
|
keyEnvVar: "QWEN_API_KEY",
|
|
91
98
|
regions: {
|
|
@@ -93,22 +100,26 @@ var providers_default = {
|
|
|
93
100
|
china: "https://coding.dashscope.aliyuncs.com/apps/anthropic"
|
|
94
101
|
},
|
|
95
102
|
models: {
|
|
96
|
-
sonnet: "qwen3-
|
|
97
|
-
opus: "qwen3-max
|
|
98
|
-
haiku: "qwen3-
|
|
99
|
-
}
|
|
103
|
+
sonnet: "qwen3.7-plus",
|
|
104
|
+
opus: "qwen3.7-max",
|
|
105
|
+
haiku: "qwen3.7-plus"
|
|
106
|
+
},
|
|
107
|
+
supportedCapabilities: ["effort", "thinking"],
|
|
108
|
+
thinkingNote: "Supports thinking_budget for token-level control"
|
|
100
109
|
},
|
|
101
110
|
glm: {
|
|
102
111
|
name: "GLM",
|
|
103
112
|
baseUrl: "https://api.z.ai/api/anthropic",
|
|
104
|
-
defaultModel: "glm-5",
|
|
113
|
+
defaultModel: "glm-5.2",
|
|
105
114
|
aliases: ["glm5"],
|
|
106
115
|
keyEnvVar: "GLM_API_KEY",
|
|
107
116
|
regions: {
|
|
108
117
|
global: "https://api.z.ai/api/anthropic",
|
|
109
118
|
china: "https://open.bigmodel.cn/api/anthropic"
|
|
110
119
|
},
|
|
111
|
-
models: { sonnet: "glm-5", opus: "glm-5", haiku: "glm-5" }
|
|
120
|
+
models: { sonnet: "glm-5.2", opus: "glm-5.2", haiku: "glm-5.2" },
|
|
121
|
+
supportedCapabilities: ["effort", "max_effort", "thinking"],
|
|
122
|
+
thinkingNote: "Two-tier effort: high and max"
|
|
112
123
|
},
|
|
113
124
|
seed: {
|
|
114
125
|
name: "Seed/Doubao",
|
|
@@ -120,29 +131,33 @@ var providers_default = {
|
|
|
120
131
|
sonnet: "ark-code-latest",
|
|
121
132
|
opus: "ark-code-latest",
|
|
122
133
|
haiku: "ark-code-latest"
|
|
123
|
-
}
|
|
134
|
+
},
|
|
135
|
+
supportedCapabilities: ["thinking"],
|
|
136
|
+
thinkingNote: "Thinking on/off only, no effort levels"
|
|
124
137
|
},
|
|
125
138
|
stepfun: {
|
|
126
139
|
name: "StepFun",
|
|
127
140
|
baseUrl: "https://api.stepfun.ai/v1/anthropic",
|
|
128
|
-
defaultModel: "step-3.
|
|
141
|
+
defaultModel: "step-3.7-flash",
|
|
129
142
|
aliases: ["sf"],
|
|
130
143
|
keyEnvVar: "STEPFUN_API_KEY",
|
|
131
144
|
models: {
|
|
132
|
-
sonnet: "step-3.
|
|
133
|
-
opus: "step-3.
|
|
134
|
-
haiku: "step-3.
|
|
135
|
-
}
|
|
145
|
+
sonnet: "step-3.7-flash",
|
|
146
|
+
opus: "step-3.7-flash",
|
|
147
|
+
haiku: "step-3.7-flash"
|
|
148
|
+
},
|
|
149
|
+
supportedCapabilities: ["effort", "thinking"],
|
|
150
|
+
thinkingNote: "Effort levels: none/low/medium/high"
|
|
136
151
|
},
|
|
137
152
|
openrouter: {
|
|
138
153
|
name: "OpenRouter",
|
|
139
154
|
baseUrl: "https://openrouter.ai/api",
|
|
140
|
-
defaultModel: "anthropic/claude-sonnet-4.
|
|
155
|
+
defaultModel: "anthropic/claude-sonnet-4.6",
|
|
141
156
|
aliases: ["or"],
|
|
142
157
|
keyEnvVar: "OPENROUTER_API_KEY",
|
|
143
158
|
models: {
|
|
144
|
-
sonnet: "anthropic/claude-sonnet-4.
|
|
145
|
-
opus: "anthropic/claude-opus-4.
|
|
159
|
+
sonnet: "anthropic/claude-sonnet-4.6",
|
|
160
|
+
opus: "anthropic/claude-opus-4.8",
|
|
146
161
|
haiku: "anthropic/claude-haiku-4.5"
|
|
147
162
|
}
|
|
148
163
|
}
|
|
@@ -279,7 +294,10 @@ var ENV_KEYS = [
|
|
|
279
294
|
"ANTHROPIC_DEFAULT_SONNET_MODEL",
|
|
280
295
|
"ANTHROPIC_DEFAULT_OPUS_MODEL",
|
|
281
296
|
"ANTHROPIC_DEFAULT_HAIKU_MODEL",
|
|
282
|
-
"CLAUDE_CODE_SUBAGENT_MODEL"
|
|
297
|
+
"CLAUDE_CODE_SUBAGENT_MODEL",
|
|
298
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES",
|
|
299
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES",
|
|
300
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES"
|
|
283
301
|
];
|
|
284
302
|
async function readSettings(filePath) {
|
|
285
303
|
try {
|
|
@@ -301,7 +319,11 @@ async function applyEnvBlock(filePath, envBlock) {
|
|
|
301
319
|
const settings = await readSettings(filePath);
|
|
302
320
|
const env = { ...settings.env ?? {} };
|
|
303
321
|
for (const [k, v] of Object.entries(envBlock)) {
|
|
304
|
-
if (v
|
|
322
|
+
if (v === "") {
|
|
323
|
+
delete env[k];
|
|
324
|
+
} else if (v !== void 0) {
|
|
325
|
+
env[k] = v;
|
|
326
|
+
}
|
|
305
327
|
}
|
|
306
328
|
settings.env = env;
|
|
307
329
|
settings[CCS_MANAGED_KEY] = true;
|
|
@@ -366,6 +388,7 @@ async function doSwitch(providerName, region, scope) {
|
|
|
366
388
|
);
|
|
367
389
|
process.exit(1);
|
|
368
390
|
}
|
|
391
|
+
const caps = provider.supportedCapabilities?.join(",") ?? "";
|
|
369
392
|
const envBlock = {
|
|
370
393
|
ANTHROPIC_BASE_URL: baseUrl,
|
|
371
394
|
ANTHROPIC_AUTH_TOKEN: apiKey ?? "",
|
|
@@ -373,7 +396,10 @@ async function doSwitch(providerName, region, scope) {
|
|
|
373
396
|
ANTHROPIC_DEFAULT_SONNET_MODEL: provider.models.sonnet,
|
|
374
397
|
ANTHROPIC_DEFAULT_OPUS_MODEL: provider.models.opus,
|
|
375
398
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: provider.models.haiku,
|
|
376
|
-
CLAUDE_CODE_SUBAGENT_MODEL: provider.models.sonnet
|
|
399
|
+
CLAUDE_CODE_SUBAGENT_MODEL: provider.models.sonnet,
|
|
400
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES: caps,
|
|
401
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES: caps,
|
|
402
|
+
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES: caps
|
|
377
403
|
};
|
|
378
404
|
if (scope === "project") {
|
|
379
405
|
await writeProjectSettings(envBlock);
|
|
@@ -385,6 +411,7 @@ async function doSwitch(providerName, region, scope) {
|
|
|
385
411
|
info(`Base URL: ${baseUrl}`);
|
|
386
412
|
info(`Model: ${provider.defaultModel}`);
|
|
387
413
|
if (apiKey) info(`Key: ${maskKey2(apiKey)}`);
|
|
414
|
+
if (provider.thinkingNote) info(`Thinking: ${provider.thinkingNote}`);
|
|
388
415
|
}
|
|
389
416
|
function registerSwitchCommand(program2) {
|
|
390
417
|
program2.argument("<provider>", "Provider name or alias").argument("[region]", "Optional region (global, china, etc.)").action(async (provider, region) => {
|
|
@@ -418,12 +445,15 @@ function registerStatusCommand(program2) {
|
|
|
418
445
|
const key = env["ANTHROPIC_AUTH_TOKEN"] ?? "";
|
|
419
446
|
console.log(`
|
|
420
447
|
${scope} settings:`);
|
|
421
|
-
|
|
448
|
+
const caps = env["ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES"];
|
|
449
|
+
const rows = [
|
|
422
450
|
["Provider", providerName],
|
|
423
451
|
["Base URL", baseUrl],
|
|
424
452
|
["Model", model],
|
|
425
453
|
["API Key", key ? maskKey2(key) : "(not set)"]
|
|
426
|
-
]
|
|
454
|
+
];
|
|
455
|
+
if (caps) rows.push(["Capabilities", caps]);
|
|
456
|
+
table(rows);
|
|
427
457
|
}
|
|
428
458
|
const hasAny = userSettings.env?.["ANTHROPIC_BASE_URL"] || projectSettings.env?.["ANTHROPIC_BASE_URL"];
|
|
429
459
|
if (!hasAny) {
|
|
@@ -434,6 +464,13 @@ ${scope} settings:`);
|
|
|
434
464
|
|
|
435
465
|
// src/commands/list.ts
|
|
436
466
|
import chalk2 from "chalk";
|
|
467
|
+
function thinkingIndicator(key, caps) {
|
|
468
|
+
if (!caps) return key === "claude" ? "native" : key === "openrouter" ? "passthrough" : "";
|
|
469
|
+
if (caps.includes("adaptive_thinking")) return "adaptive";
|
|
470
|
+
if (caps.includes("thinking") && caps.includes("effort")) return "effort";
|
|
471
|
+
if (caps.includes("thinking")) return "on/off";
|
|
472
|
+
return "";
|
|
473
|
+
}
|
|
437
474
|
function registerListCommand(program2) {
|
|
438
475
|
program2.command("list").description("List all available providers").action(() => {
|
|
439
476
|
const registry = loadRegistry();
|
|
@@ -441,15 +478,16 @@ function registerListCommand(program2) {
|
|
|
441
478
|
console.log(chalk2.bold("\nAvailable providers:\n"));
|
|
442
479
|
console.log(
|
|
443
480
|
chalk2.dim(
|
|
444
|
-
"Name".padEnd(14) + "Aliases".padEnd(18) + "Default Model".padEnd(32) + "Regions"
|
|
481
|
+
"Name".padEnd(14) + "Aliases".padEnd(18) + "Default Model".padEnd(32) + "Thinking".padEnd(12) + "Regions"
|
|
445
482
|
)
|
|
446
483
|
);
|
|
447
|
-
console.log(chalk2.dim("\u2500".repeat(
|
|
484
|
+
console.log(chalk2.dim("\u2500".repeat(90)));
|
|
448
485
|
for (const [key, provider] of providers) {
|
|
449
486
|
const aliases = [key, ...provider.aliases].join(", ");
|
|
450
487
|
const regions = provider.regions ? Object.keys(provider.regions).join(", ") : "global";
|
|
488
|
+
const thinking = thinkingIndicator(key, provider.supportedCapabilities);
|
|
451
489
|
console.log(
|
|
452
|
-
chalk2.green(provider.name.padEnd(14)) + aliases.padEnd(18) + provider.defaultModel.padEnd(32) + chalk2.dim(regions)
|
|
490
|
+
chalk2.green(provider.name.padEnd(14)) + aliases.padEnd(18) + provider.defaultModel.padEnd(32) + chalk2.cyan(thinking.padEnd(12)) + chalk2.dim(regions)
|
|
453
491
|
);
|
|
454
492
|
}
|
|
455
493
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-provider-switcher",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Switch Claude Code between AI providers with one command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"switcher",
|
|
34
34
|
"cli"
|
|
35
35
|
],
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/yagizdo/cc-provider-switcher.git"
|
|
39
|
+
},
|
|
36
40
|
"license": "MIT",
|
|
37
41
|
"dependencies": {
|
|
38
42
|
"chalk": "^5.6.2",
|