cc-cast 1.3.5 → 1.3.7
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 +36 -36
- package/README.zh-CN.md +36 -36
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Switch Claude Code custom model configurations from the terminal in seconds.
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/cc-cast)
|
|
10
10
|
[](https://github.com/daylenjeez/cc-cast/blob/main/LICENSE)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
12
|
|
|
@@ -21,24 +21,24 @@ Switch Claude Code custom model configurations from the terminal in seconds.
|
|
|
21
21
|
## ✨ Highlights
|
|
22
22
|
|
|
23
23
|
- 🔌 **cc-switch Integration** — Reads [cc-switch](https://github.com/farion1231/cc-switch) database directly, zero migration
|
|
24
|
-
- 🧙 **Interactive Wizard** — `
|
|
25
|
-
- ⚡ **One-command Switch** — `
|
|
24
|
+
- 🧙 **Interactive Wizard** — `ccc add` guides you step by step, type `<` to go back
|
|
25
|
+
- ⚡ **One-command Switch** — `ccc use OpenRouter` or `ccc ls` with arrow keys
|
|
26
26
|
- 🛡️ **Safe Switching** — Preserves `language`, `permissions` and other personal settings
|
|
27
27
|
- 🪶 **Lightweight** — No extra features, just model switching. Tiny footprint, fast startup, no background processes
|
|
28
|
-
- 🚀 **Zero Config** — Just `
|
|
29
|
-
- 🌍 **i18n** — English / 中文 (`
|
|
28
|
+
- 🚀 **Zero Config** — Just `ccc init` and follow the prompts, no docs needed
|
|
29
|
+
- 🌍 **i18n** — English / 中文 (`ccc locale set en/zh`)
|
|
30
30
|
|
|
31
31
|
## 📦 Install
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
npm install -g
|
|
34
|
+
npm install -g cc-cast
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## 🚀 Quick Start
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
ccc init # Auto-detects cc-switch or initializes standalone mode
|
|
41
|
+
ccc add # Interactive wizard to add a provider
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## 🔌 cc-switch Integration
|
|
@@ -46,19 +46,19 @@ cc-cast add # Interactive wizard to add a provider
|
|
|
46
46
|
Already using [cc-switch](https://github.com/farion1231/cc-switch)? When the cc-switch database is detected, cc-cast works directly with it instead of using standalone storage:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
$
|
|
49
|
+
$ ccc init
|
|
50
50
|
✓ Initialized
|
|
51
51
|
✓ cc-switch detected — cc-cast will use cc-switch's configuration store directly
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
You can also run `
|
|
54
|
+
You can also run `ccc sync` at any time to pull the latest cc-switch configurations into standalone mode.
|
|
55
55
|
|
|
56
56
|
## ➕ Adding Configurations
|
|
57
57
|
|
|
58
58
|
### Interactive wizard (recommended)
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
$
|
|
61
|
+
$ ccc add
|
|
62
62
|
Provider name (e.g. OpenRouter): OpenRouter
|
|
63
63
|
|
|
64
64
|
Choose how to add:
|
|
@@ -112,57 +112,57 @@ Aliases are stored in `~/.cc-cast/rc.json`:
|
|
|
112
112
|
|
|
113
113
|
| Command | Alias | Description |
|
|
114
114
|
|---|---|---|
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
115
|
+
| `ccc init` | | Initialize, auto-detect cc-switch |
|
|
116
|
+
| `ccc list` | `ls` | Interactive list & switch |
|
|
117
|
+
| `ccc use <name>` | | Switch by name |
|
|
118
|
+
| `ccc add` | `new` | Interactive add wizard |
|
|
119
|
+
| `ccc save <name>` | | Save current settings as profile |
|
|
120
|
+
| `ccc show [name]` | | View config details (all configs in JSON if no name) |
|
|
121
|
+
| `ccc modify [name]` | `edit` | Edit existing configuration |
|
|
122
|
+
| `ccc remove [name]` | `rm` | Interactive or named delete |
|
|
123
|
+
| `ccc current` | | Show active configuration |
|
|
124
|
+
| `ccc sync` | | Sync cc-switch configs into standalone |
|
|
125
|
+
| `ccc import [file]` | | Import configs from JSON (stdin if no file) |
|
|
126
|
+
| `ccc clear` | | Clean up data files |
|
|
127
127
|
|
|
128
128
|
### Aliases
|
|
129
129
|
|
|
130
130
|
| Command | Description |
|
|
131
131
|
|---|---|
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
132
|
+
| `ccc alias set <short> <name>` | Create alias, e.g. `ccc alias set or OpenRouter` |
|
|
133
|
+
| `ccc alias rm <short>` | Remove alias |
|
|
134
|
+
| `ccc alias list` / `ls` | List all aliases |
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
ccc alias set or OpenRouter
|
|
138
|
+
ccc use or # same as: ccc use OpenRouter
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### Locale
|
|
142
142
|
|
|
143
143
|
| Command | Description |
|
|
144
144
|
|---|---|
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
145
|
+
| `ccc locale` / `ls` | List & switch language |
|
|
146
|
+
| `ccc locale set <lang>` | Set language (`zh` / `en`) |
|
|
147
147
|
|
|
148
148
|
### Examples
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
151
|
# Switch provider
|
|
152
|
-
$
|
|
152
|
+
$ ccc use OpenRouter
|
|
153
153
|
✓ Switched to OpenRouter
|
|
154
154
|
Model: anthropic/claude-opus-4.6
|
|
155
155
|
Restart Claude Code to apply
|
|
156
156
|
|
|
157
157
|
# View current config
|
|
158
|
-
$
|
|
158
|
+
$ ccc current
|
|
159
159
|
Current configuration: OpenRouter
|
|
160
160
|
ANTHROPIC_BASE_URL: https://openrouter.ai/api/v1
|
|
161
161
|
ANTHROPIC_MODEL: anthropic/claude-opus-4.6
|
|
162
162
|
ANTHROPIC_AUTH_TOKEN: sk-or-v1...a3f2
|
|
163
163
|
|
|
164
164
|
# Save current settings.json as a new profile
|
|
165
|
-
$
|
|
165
|
+
$ ccc save my-backup
|
|
166
166
|
✓ Saved current configuration as "my-backup"
|
|
167
167
|
```
|
|
168
168
|
|
|
@@ -179,13 +179,13 @@ Claude Code reads `~/.claude/settings.json` on startup. The `env` field controls
|
|
|
179
179
|
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | Model used when selecting Sonnet via `/model` |
|
|
180
180
|
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | Model used when selecting Haiku via `/model` |
|
|
181
181
|
|
|
182
|
-
`
|
|
182
|
+
`ccc use` writes the selected profile into `settings.json` while preserving personal settings (`language`, `permissions`, etc.). Restart Claude Code to apply.
|
|
183
183
|
|
|
184
184
|
## 🗑️ Uninstall
|
|
185
185
|
|
|
186
186
|
Removing `cc-cast` only removes the CLI itself. Your data files are left behind.
|
|
187
187
|
|
|
188
|
-
Use `
|
|
188
|
+
Use `ccc clear` to delete them automatically, or clean them up manually:
|
|
189
189
|
|
|
190
190
|
- `~/.cc-cast/rc.json` — aliases and locale
|
|
191
191
|
- `~/.cc-cast/config.json` — profiles
|
|
@@ -194,7 +194,7 @@ Use `cc-cast clear` to delete them automatically, or clean them up manually:
|
|
|
194
194
|
Then remove the CLI:
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
|
-
npm uninstall -g
|
|
197
|
+
npm uninstall -g cc-cast
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
## 📄 License
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
在终端几秒内完成 Claude Code 自定义模型配置的管理和切换。
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/cc-cast)
|
|
10
10
|
[](https://github.com/daylenjeez/cc-cast/blob/main/LICENSE)
|
|
11
11
|
[](https://nodejs.org)
|
|
12
12
|
|
|
@@ -21,24 +21,24 @@
|
|
|
21
21
|
## ✨ 亮点
|
|
22
22
|
|
|
23
23
|
- 🔌 **cc-switch Integration** — 直接读取 `cc-switch` 数据库,无需迁移
|
|
24
|
-
- 🧙 **Interactive Wizard** — `
|
|
25
|
-
- ⚡ **One-command Switch** — `
|
|
24
|
+
- 🧙 **Interactive Wizard** — `ccc add` 逐步引导,输入 `<` 可返回上一步
|
|
25
|
+
- ⚡ **One-command Switch** — `ccc use OpenRouter` 或 `ccc ls` 方向键选择
|
|
26
26
|
- 🛡️ **Safe Switching** — 自动保留 `language`、`permissions` 等个人设置
|
|
27
27
|
- 🪶 **轻量** — 没有多余功能,只做模型切换。体积小巧,启动迅速,无后台进程
|
|
28
|
-
- 🚀 **Zero Config** — 直接 `
|
|
29
|
-
- 🌍 **i18n** — `
|
|
28
|
+
- 🚀 **Zero Config** — 直接 `ccc init`,跟着提示走,无需阅读文档
|
|
29
|
+
- 🌍 **i18n** — `ccc locale set zh/en` 切换界面语言
|
|
30
30
|
|
|
31
31
|
## 📦 安装
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
npm install -g
|
|
34
|
+
npm install -g cc-cast
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## 🚀 快速开始
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
ccc init # 自动检测 cc-switch 或初始化独立模式
|
|
41
|
+
ccc add # 交互式向导添加供应商
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
## 🔌 cc-switch 集成
|
|
@@ -46,19 +46,19 @@ cc-cast add # 交互式向导添加供应商
|
|
|
46
46
|
已经在用 [cc-switch](https://github.com/farion1231/cc-switch)?检测到 cc-switch 数据库时,cc-cast 会直接使用它的配置库,无需迁移:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
$
|
|
49
|
+
$ ccc init
|
|
50
50
|
✓ 初始化完成
|
|
51
51
|
✓ 检测到 cc-switch,cc-cast 将直接使用 cc-switch 配置库
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
你也可以随时运行 `
|
|
54
|
+
你也可以随时运行 `ccc sync` 将最新的 cc-switch 配置同步到独立模式。
|
|
55
55
|
|
|
56
56
|
## ➕ 添加配置
|
|
57
57
|
|
|
58
58
|
### 交互式向导(推荐)
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
$
|
|
61
|
+
$ ccc add
|
|
62
62
|
供应商名称 (如 OpenRouter): OpenRouter
|
|
63
63
|
|
|
64
64
|
选择添加方式:
|
|
@@ -112,57 +112,57 @@ ANTHROPIC_DEFAULT_HAIKU_MODEL (可选):
|
|
|
112
112
|
|
|
113
113
|
| 命令 | 缩写 | 说明 |
|
|
114
114
|
|---|---|---|
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
115
|
+
| `ccc init` | | 初始化,自动检测 cc-switch |
|
|
116
|
+
| `ccc list` | `ls` | 交互式列表 & 切换 |
|
|
117
|
+
| `ccc use <name>` | | 按名称切换 |
|
|
118
|
+
| `ccc add` | `new` | 交互式添加向导 |
|
|
119
|
+
| `ccc save <name>` | | 将当前设置保存为方案 |
|
|
120
|
+
| `ccc show [name]` | | 查看配置详情(无名称时输出全部 JSON) |
|
|
121
|
+
| `ccc modify [name]` | `edit` | 修改已有配置 |
|
|
122
|
+
| `ccc remove [name]` | `rm` | 交互式或指定名称删除 |
|
|
123
|
+
| `ccc current` | | 显示当前激活配置 |
|
|
124
|
+
| `ccc sync` | | 从 cc-switch 同步配置到本地 |
|
|
125
|
+
| `ccc import [file]` | | 从 JSON 导入配置(无文件时从 stdin 读取) |
|
|
126
|
+
| `ccc clear` | | 清理数据文件 |
|
|
127
127
|
|
|
128
128
|
### 别名管理
|
|
129
129
|
|
|
130
130
|
| 命令 | 说明 |
|
|
131
131
|
|---|---|
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
132
|
+
| `ccc alias set <short> <name>` | 创建别名,如 `ccc alias set or OpenRouter` |
|
|
133
|
+
| `ccc alias rm <short>` | 删除别名 |
|
|
134
|
+
| `ccc alias list` / `ls` | 列出所有别名 |
|
|
135
135
|
|
|
136
136
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
ccc alias set or OpenRouter
|
|
138
|
+
ccc use or # 等同于: cc-cast use OpenRouter
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### 语言设置
|
|
142
142
|
|
|
143
143
|
| 命令 | 说明 |
|
|
144
144
|
|---|---|
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
145
|
+
| `ccc locale` / `ls` | 列出并切换语言 |
|
|
146
|
+
| `ccc locale set <lang>` | 设置语言(`zh` / `en`) |
|
|
147
147
|
|
|
148
148
|
### 使用示例
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
151
|
# 切换供应商
|
|
152
|
-
$
|
|
152
|
+
$ ccc use OpenRouter
|
|
153
153
|
✓ 已切换到 OpenRouter
|
|
154
154
|
模型: anthropic/claude-opus-4.6
|
|
155
155
|
重启 Claude Code 生效
|
|
156
156
|
|
|
157
157
|
# 查看当前配置
|
|
158
|
-
$
|
|
158
|
+
$ ccc current
|
|
159
159
|
当前配置: OpenRouter
|
|
160
160
|
ANTHROPIC_BASE_URL: https://openrouter.ai/api/v1
|
|
161
161
|
ANTHROPIC_MODEL: anthropic/claude-opus-4.6
|
|
162
162
|
ANTHROPIC_AUTH_TOKEN: sk-or-v1...a3f2
|
|
163
163
|
|
|
164
164
|
# 将当前 settings.json 保存为新方案
|
|
165
|
-
$
|
|
165
|
+
$ ccc save my-backup
|
|
166
166
|
✓ 已保存当前配置为 "my-backup"
|
|
167
167
|
```
|
|
168
168
|
|
|
@@ -179,13 +179,13 @@ Claude Code 启动时读取 `~/.claude/settings.json`,`env` 字段控制 API
|
|
|
179
179
|
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | 选择 Sonnet 时使用的模型 |
|
|
180
180
|
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | 选择 Haiku 时使用的模型 |
|
|
181
181
|
|
|
182
|
-
`
|
|
182
|
+
`ccc use` 将选中配置写入 `settings.json`,同时保留 `language`、`permissions` 等个人设置。重启 Claude Code 后生效。
|
|
183
183
|
|
|
184
184
|
## 🗑️ 卸载
|
|
185
185
|
|
|
186
186
|
卸载 `cc-cast` 只会删除 CLI 程序本身,相关的数据文件仍然保留。
|
|
187
187
|
|
|
188
|
-
你可以先运行 `
|
|
188
|
+
你可以先运行 `ccc clear` 自动清理数据文件,也可以手动删除:
|
|
189
189
|
|
|
190
190
|
- `~/.cc-cast/rc.json` — 别名和语言设置
|
|
191
191
|
- `~/.cc-cast/config.json` — 配置方案
|
|
@@ -194,7 +194,7 @@ Claude Code 启动时读取 `~/.claude/settings.json`,`env` 字段控制 API
|
|
|
194
194
|
然后移除 CLI:
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
|
-
npm uninstall -g
|
|
197
|
+
npm uninstall -g cc-cast
|
|
198
198
|
```
|
|
199
199
|
|
|
200
200
|
## 📄 License
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ const packageJsonPath = join(__dirname, "..", "package.json");
|
|
|
44
44
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
45
45
|
const program = new Command();
|
|
46
46
|
program
|
|
47
|
-
.name("
|
|
47
|
+
.name("ccc")
|
|
48
48
|
.description(t("program.description"))
|
|
49
49
|
.version(packageJson.version);
|
|
50
50
|
// Helper: prompt user for input, optionally pre-filling the input field
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-cast",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "Claude Code Model Switcher - 快速切换 Claude Code 自定义模型配置",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"ccm": "dist/index.js",
|
|
9
|
+
"ccc": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
package/src/index.ts
CHANGED