cc-provider-switcher 0.2.1 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +6 -8
  2. package/dist/cli.js +12 -21
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/cc-provider-switcher.svg)](https://www.npmjs.com/package/cc-provider-switcher)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
5
- [![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](https://nodejs.org)
6
6
 
7
7
  Switch Claude Code between AI providers with one command.
8
8
 
@@ -88,7 +88,7 @@ ccs seed
88
88
  | `ccs list` | List all available providers |
89
89
  | `ccs status` | Show current provider, model, and API key |
90
90
  | `ccs config` | Interactive API key setup |
91
- | `ccs reset` | Remove ccs-managed settings |
91
+ | `ccs reset` | Remove ccs-managed settings and return to Claude Code's native default |
92
92
  | `ccs reset --project` | Reset project-level settings |
93
93
  | `ccs reset --all` | Reset both user and project settings |
94
94
  | `ccs doctor` | Diagnose environment issues |
@@ -111,13 +111,13 @@ ccs seed
111
111
  | Seed/Doubao | `seed` | `doubao` | on/off | global |
112
112
  | StepFun | `stepfun` | `sf` | effort | global |
113
113
  | OpenRouter | `openrouter` | `or` | passthrough | global |
114
- | Claude (Anthropic) | `claude` | `anthropic`, `sonnet` | native | global |
114
+
115
+ Claude (Anthropic) isn't a switchable provider — it's Claude Code's own native default. Run `ccs reset` to return to it.
115
116
 
116
117
  **Thinking column:**
117
118
  - `effort` — reasoning_effort levels (low/medium/high)
118
119
  - `adaptive` — adaptive thinking only (`enabled` causes 400 on this provider)
119
120
  - `on/off` — thinking enabled/disabled, no effort control
120
- - `native` — Claude Code's built-in detection applies
121
121
  - `passthrough` — depends on the model routed through OpenRouter
122
122
 
123
123
  ### Model mapping
@@ -128,13 +128,12 @@ When Claude Code picks haiku/sonnet/opus, ccs maps them to the actual model IDs
128
128
  |----------|-------|--------|------|
129
129
  | DeepSeek | `deepseek-v4-flash` | `deepseek-v4-flash` | `deepseek-v4-pro` |
130
130
  | MiniMax | `MiniMax-M3` | `MiniMax-M3` | `MiniMax-M3` |
131
- | Kimi | `kimi-k2.7-code-highspeed` | `kimi-k2.7-code-highspeed` | `kimi-k2.7-code` |
131
+ | Kimi | `kimi-k3` | `kimi-k3` | `kimi-k3` |
132
132
  | Qwen | `qwen3.7-plus` | `qwen3.7-plus` | `qwen3.7-max` |
133
133
  | GLM | `glm-5.2` | `glm-5.2` | `glm-5.2` |
134
134
  | Seed/Doubao | `ark-code-latest` | `ark-code-latest` | `ark-code-latest` |
135
135
  | StepFun | `step-3.7-flash` | `step-3.7-flash` | `step-3.7-flash` |
136
- | OpenRouter | `anthropic/claude-haiku-4.5` | `anthropic/claude-sonnet-4.6` | `anthropic/claude-opus-4.8` |
137
- | Claude (Anthropic) | `claude-haiku-4-5-20251001` | `claude-sonnet-4-6` | `claude-opus-4-8` |
136
+ | OpenRouter | `anthropic/claude-haiku-4.5` | `anthropic/claude-sonnet-5` | `anthropic/claude-opus-4.8` |
138
137
 
139
138
  Override any ID via `providerOverrides` in `~/.ccs/config.json` — see [Override model IDs](#override-model-ids).
140
139
 
@@ -250,7 +249,6 @@ Add an entry to `src/providers/providers.json` and submit a PR:
250
249
  - `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.
251
250
  - `thinkingNote` — shown as an info line after switching, to warn about provider-specific limits.
252
251
  - `regions` — map of region name → base URL.
253
- - `optional` — if `true`, missing API key is not a fatal error (used for Claude native).
254
252
 
255
253
  ---
256
254
 
package/dist/cli.js CHANGED
@@ -18,7 +18,6 @@ var ProviderSchema = z.object({
18
18
  haiku: z.string()
19
19
  }),
20
20
  regions: z.record(z.string(), z.string()).optional(),
21
- optional: z.boolean().optional(),
22
21
  supportedCapabilities: z.array(z.string()).optional(),
23
22
  thinkingNote: z.string().optional()
24
23
  });
@@ -64,30 +63,17 @@ var providers_default = {
64
63
  supportedCapabilities: ["adaptive_thinking"],
65
64
  thinkingNote: "Only adaptive/disabled thinking (enabled returns 400)"
66
65
  },
67
- claude: {
68
- name: "Claude (Anthropic)",
69
- baseUrl: "https://api.anthropic.com/",
70
- defaultModel: "claude-sonnet-4-6",
71
- aliases: ["anthropic", "sonnet"],
72
- keyEnvVar: "CLAUDE_API_KEY",
73
- optional: true,
74
- models: {
75
- sonnet: "claude-sonnet-4-6",
76
- opus: "claude-opus-4-8",
77
- haiku: "claude-haiku-4-5-20251001"
78
- }
79
- },
80
66
  kimi: {
81
67
  name: "Kimi",
82
68
  baseUrl: "https://api.moonshot.ai/anthropic",
83
- defaultModel: "kimi-k2.7-code",
69
+ defaultModel: "kimi-k3",
84
70
  aliases: ["kimi2"],
85
71
  keyEnvVar: "KIMI_API_KEY",
86
72
  regions: {
87
73
  global: "https://api.moonshot.ai/anthropic",
88
74
  china: "https://api.moonshot.cn/anthropic"
89
75
  },
90
- models: { sonnet: "kimi-k2.7-code-highspeed", opus: "kimi-k2.7-code", haiku: "kimi-k2.7-code-highspeed" },
76
+ models: { sonnet: "kimi-k3", opus: "kimi-k3", haiku: "kimi-k3" },
91
77
  supportedCapabilities: ["effort", "thinking"]
92
78
  },
93
79
  qwen: {
@@ -153,11 +139,11 @@ var providers_default = {
153
139
  openrouter: {
154
140
  name: "OpenRouter",
155
141
  baseUrl: "https://openrouter.ai/api",
156
- defaultModel: "anthropic/claude-sonnet-4.6",
142
+ defaultModel: "anthropic/claude-sonnet-5",
157
143
  aliases: ["or"],
158
144
  keyEnvVar: "OPENROUTER_API_KEY",
159
145
  models: {
160
- sonnet: "anthropic/claude-sonnet-4.6",
146
+ sonnet: "anthropic/claude-sonnet-5",
161
147
  opus: "anthropic/claude-opus-4.8",
162
148
  haiku: "anthropic/claude-haiku-4.5"
163
149
  }
@@ -268,7 +254,6 @@ async function initConfig(configPath = CCS_CONFIG_FILE) {
268
254
  const question = (prompt) => new Promise((resolve) => rl.question(prompt, resolve));
269
255
  console.log("Configure API keys for each provider (leave blank to skip):\n");
270
256
  for (const [key, provider] of Object.entries(registry.providers)) {
271
- if (provider.optional) continue;
272
257
  const existing = current.keys[key] ? ` [${maskKey(current.keys[key])}]` : "";
273
258
  const answer = await question(`${provider.name}${existing}: `);
274
259
  if (answer.trim()) current.keys[key] = answer.trim();
@@ -378,12 +363,18 @@ function table(rows) {
378
363
  }
379
364
 
380
365
  // src/commands/switch.ts
366
+ var CLAUDE_NATIVE_NAMES = /* @__PURE__ */ new Set(["claude", "anthropic", "sonnet"]);
381
367
  async function doSwitch(providerName, region, scope) {
368
+ if (CLAUDE_NATIVE_NAMES.has(providerName.toLowerCase())) {
369
+ info("Claude is Claude Code's native default \u2014 there is nothing to switch to.");
370
+ info('Run "ccs reset" to clear provider overrides and return to it.');
371
+ return;
372
+ }
382
373
  const userConfig = await loadUserConfig();
383
374
  const provider = resolveProvider(providerName, userConfig);
384
375
  const baseUrl = resolveBaseUrl(provider, region);
385
376
  const apiKey = getApiKey(provider, userConfig);
386
- if (!apiKey && !provider.optional) {
377
+ if (!apiKey) {
387
378
  error(
388
379
  `No API key for ${provider.name}. Set ${provider.keyEnvVar} or run "ccs config".`
389
380
  );
@@ -466,7 +457,7 @@ ${scope} settings:`);
466
457
  // src/commands/list.ts
467
458
  import chalk2 from "chalk";
468
459
  function thinkingIndicator(key, caps) {
469
- if (!caps) return key === "claude" ? "native" : key === "openrouter" ? "passthrough" : "";
460
+ if (!caps) return key === "openrouter" ? "passthrough" : "";
470
461
  if (caps.includes("adaptive_thinking")) return "adaptive";
471
462
  if (caps.includes("thinking") && caps.includes("effort")) return "effort";
472
463
  if (caps.includes("thinking")) return "on/off";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-provider-switcher",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Switch Claude Code between AI providers with one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,13 +17,14 @@
17
17
  }
18
18
  },
19
19
  "engines": {
20
- "node": ">=22"
20
+ "node": ">=20"
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsup",
24
24
  "dev": "tsx src/cli.ts",
25
25
  "test": "vitest run",
26
26
  "test:watch": "vitest",
27
+ "prepare": "npm run build",
27
28
  "prepublishOnly": "npm run build"
28
29
  },
29
30
  "keywords": [