cc-cast 1.3.6 → 1.3.8

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 CHANGED
@@ -21,12 +21,12 @@ 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** — `cc-cast add` guides you step by step, type `<` to go back
25
- - ⚡ **One-command Switch** — `cc-cast use OpenRouter` or `cc-cast ls` with arrow keys
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 `cc-cast init` and follow the prompts, no docs needed
29
- - 🌍 **i18n** — English / 中文 (`cc-cast locale set en/zh`)
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
 
@@ -37,8 +37,8 @@ npm install -g cc-cast
37
37
  ## 🚀 Quick Start
38
38
 
39
39
  ```bash
40
- cc-cast init # Auto-detects cc-switch or initializes standalone mode
41
- cc-cast add # Interactive wizard to add a provider
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
- $ cc-cast init
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 `cc-cast sync` at any time to pull the latest cc-switch configurations into standalone mode.
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
- $ cc-cast add
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
- | `cc-cast init` | | Initialize, auto-detect cc-switch |
116
- | `cc-cast list` | `ls` | Interactive list & switch |
117
- | `cc-cast use <name>` | | Switch by name |
118
- | `cc-cast add` | `new` | Interactive add wizard |
119
- | `cc-cast save <name>` | | Save current settings as profile |
120
- | `cc-cast show [name]` | | View config details (all configs in JSON if no name) |
121
- | `cc-cast modify [name]` | `edit` | Edit existing configuration |
122
- | `cc-cast remove [name]` | `rm` | Interactive or named delete |
123
- | `cc-cast current` | | Show active configuration |
124
- | `cc-cast sync` | | Sync cc-switch configs into standalone |
125
- | `cc-cast import [file]` | | Import configs from JSON (stdin if no file) |
126
- | `cc-cast clear` | | Clean up data files |
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
- | `cc-cast alias set <short> <name>` | Create alias, e.g. `cc-cast alias set or OpenRouter` |
133
- | `cc-cast alias rm <short>` | Remove alias |
134
- | `cc-cast alias list` / `ls` | List all aliases |
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
- cc-cast alias set or OpenRouter
138
- cc-cast use or # same as: cc-cast use OpenRouter
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
- | `cc-cast locale` / `ls` | List & switch language |
146
- | `cc-cast locale set <lang>` | Set language (`zh` / `en`) |
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
- $ cc-cast use OpenRouter
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
- $ cc-cast current
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
- $ cc-cast save my-backup
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
- `cc-cast use` writes the selected profile into `settings.json` while preserving personal settings (`language`, `permissions`, etc.). Restart Claude Code to apply.
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 `cc-cast clear` to delete them automatically, or clean them up manually:
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
package/README.zh-CN.md CHANGED
@@ -21,12 +21,12 @@
21
21
  ## ✨ 亮点
22
22
 
23
23
  - 🔌 **cc-switch Integration** — 直接读取 `cc-switch` 数据库,无需迁移
24
- - 🧙 **Interactive Wizard** — `cc-cast add` 逐步引导,输入 `<` 可返回上一步
25
- - ⚡ **One-command Switch** — `cc-cast use OpenRouter` 或 `cc-cast ls` 方向键选择
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** — 直接 `cc-cast init`,跟着提示走,无需阅读文档
29
- - 🌍 **i18n** — `cc-cast locale set zh/en` 切换界面语言
28
+ - 🚀 **Zero Config** — 直接 `ccc init`,跟着提示走,无需阅读文档
29
+ - 🌍 **i18n** — `ccc locale set zh/en` 切换界面语言
30
30
 
31
31
  ## 📦 安装
32
32
 
@@ -37,8 +37,8 @@ npm install -g cc-cast
37
37
  ## 🚀 快速开始
38
38
 
39
39
  ```bash
40
- cc-cast init # 自动检测 cc-switch 或初始化独立模式
41
- cc-cast add # 交互式向导添加供应商
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
- $ cc-cast init
49
+ $ ccc init
50
50
  ✓ 初始化完成
51
51
  ✓ 检测到 cc-switch,cc-cast 将直接使用 cc-switch 配置库
52
52
  ```
53
53
 
54
- 你也可以随时运行 `cc-cast sync` 将最新的 cc-switch 配置同步到独立模式。
54
+ 你也可以随时运行 `ccc sync` 将最新的 cc-switch 配置同步到独立模式。
55
55
 
56
56
  ## ➕ 添加配置
57
57
 
58
58
  ### 交互式向导(推荐)
59
59
 
60
60
  ```bash
61
- $ cc-cast add
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
- | `cc-cast init` | | 初始化,自动检测 cc-switch |
116
- | `cc-cast list` | `ls` | 交互式列表 & 切换 |
117
- | `cc-cast use <name>` | | 按名称切换 |
118
- | `cc-cast add` | `new` | 交互式添加向导 |
119
- | `cc-cast save <name>` | | 将当前设置保存为方案 |
120
- | `cc-cast show [name]` | | 查看配置详情(无名称时输出全部 JSON) |
121
- | `cc-cast modify [name]` | `edit` | 修改已有配置 |
122
- | `cc-cast remove [name]` | `rm` | 交互式或指定名称删除 |
123
- | `cc-cast current` | | 显示当前激活配置 |
124
- | `cc-cast sync` | | 从 cc-switch 同步配置到本地 |
125
- | `cc-cast import [file]` | | 从 JSON 导入配置(无文件时从 stdin 读取) |
126
- | `cc-cast clear` | | 清理数据文件 |
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
- | `cc-cast alias set <short> <name>` | 创建别名,如 `cc-cast alias set or OpenRouter` |
133
- | `cc-cast alias rm <short>` | 删除别名 |
134
- | `cc-cast alias list` / `ls` | 列出所有别名 |
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
- cc-cast alias set or OpenRouter
138
- cc-cast use or # 等同于: cc-cast use OpenRouter
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
- | `cc-cast locale` / `ls` | 列出并切换语言 |
146
- | `cc-cast locale set <lang>` | 设置语言(`zh` / `en`) |
145
+ | `ccc locale` / `ls` | 列出并切换语言 |
146
+ | `ccc locale set <lang>` | 设置语言(`zh` / `en`) |
147
147
 
148
148
  ### 使用示例
149
149
 
150
150
  ```bash
151
151
  # 切换供应商
152
- $ cc-cast use OpenRouter
152
+ $ ccc use OpenRouter
153
153
  ✓ 已切换到 OpenRouter
154
154
  模型: anthropic/claude-opus-4.6
155
155
  重启 Claude Code 生效
156
156
 
157
157
  # 查看当前配置
158
- $ cc-cast current
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
- $ cc-cast save my-backup
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
- `cc-cast use` 将选中配置写入 `settings.json`,同时保留 `language`、`permissions` 等个人设置。重启 Claude Code 后生效。
182
+ `ccc use` 将选中配置写入 `settings.json`,同时保留 `language`、`permissions` 等个人设置。重启 Claude Code 后生效。
183
183
 
184
184
  ## 🗑️ 卸载
185
185
 
186
186
  卸载 `cc-cast` 只会删除 CLI 程序本身,相关的数据文件仍然保留。
187
187
 
188
- 你可以先运行 `cc-cast clear` 自动清理数据文件,也可以手动删除:
188
+ 你可以先运行 `ccc clear` 自动清理数据文件,也可以手动删除:
189
189
 
190
190
  - `~/.cc-cast/rc.json` — 别名和语言设置
191
191
  - `~/.cc-cast/config.json` — 配置方案
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { join, dirname } from "path";
12
12
  import { fileURLToPath } from "url";
13
13
  import { t, setLocale, getLocale } from "./i18n/index.js";
14
14
  import Enquirer from "enquirer";
15
+ import updateNotifier from "update-notifier";
15
16
  const Select = Enquirer.Select;
16
17
  function createSelect(options) {
17
18
  const prompt = new Select(options);
@@ -42,6 +43,8 @@ function createSelect(options) {
42
43
  const __dirname = dirname(fileURLToPath(import.meta.url));
43
44
  const packageJsonPath = join(__dirname, "..", "package.json");
44
45
  const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
46
+ const notifier = updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 * 60 * 24 });
47
+ notifier.notify({ isGlobal: true, defer: true });
45
48
  const program = new Command();
46
49
  program
47
50
  .name("ccc")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-cast",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Claude Code Model Switcher - 快速切换 Claude Code 自定义模型配置",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,11 +27,13 @@
27
27
  "better-sqlite3": "^12.8.0",
28
28
  "chalk": "^5.6.2",
29
29
  "commander": "^14.0.3",
30
- "enquirer": "^2.4.1"
30
+ "enquirer": "^2.4.1",
31
+ "update-notifier": "^7.3.1"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@types/better-sqlite3": "^7.6.13",
34
35
  "@types/node": "^25.5.2",
36
+ "@types/update-notifier": "^6.0.8",
35
37
  "typescript": "^6.0.2"
36
38
  }
37
39
  }
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ import { join, dirname } from "path";
13
13
  import { fileURLToPath } from "url";
14
14
  import { t, setLocale, getLocale } from "./i18n/index.js";
15
15
  import Enquirer from "enquirer";
16
+ import updateNotifier from "update-notifier";
16
17
  const Select = (Enquirer as any).Select;
17
18
 
18
19
  function createSelect(options: any) {
@@ -45,6 +46,9 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
45
46
  const packageJsonPath = join(__dirname, "..", "package.json");
46
47
  const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
47
48
 
49
+ const notifier = updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 * 60 * 24 });
50
+ notifier.notify({ isGlobal: true, defer: true });
51
+
48
52
  const program = new Command();
49
53
 
50
54
  program