@musistudio/claude-code-router 1.0.72 → 2.0.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 CHANGED
@@ -8,13 +8,11 @@
8
8
 
9
9
  ![](blog/images/sponsors/glm-en.jpg)
10
10
  > This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN.
11
- > GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.6 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
11
+ > GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.7 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
12
12
  > Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
13
13
 
14
14
  > A powerful tool to route Claude Code requests to different models and customize any request.
15
15
 
16
- > [GLM-4.6 Supports Reasoning and Interleaved Thinking](blog/en/glm-4.6-supports-reasoning.md)
17
-
18
16
  ![](blog/images/claude-code.png)
19
17
 
20
18
  ## ✨ Features
@@ -255,7 +253,45 @@ This command provides an interactive interface to:
255
253
 
256
254
  The CLI tool validates all inputs and provides helpful prompts to guide you through the configuration process, making it easy to manage complex setups without editing JSON files manually.
257
255
 
258
- ### 6. Activate Command (Environment Variables Setup)
256
+ ### 6. Presets Management
257
+
258
+ Presets allow you to save, share, and reuse configurations easily. You can export your current configuration as a preset and install presets from files or URLs.
259
+
260
+ ```shell
261
+ # Export current configuration as a preset
262
+ ccr preset export my-preset
263
+
264
+ # Export with metadata
265
+ ccr preset export my-preset --description "My OpenAI config" --author "Your Name" --tags "openai,production"
266
+
267
+ # Install a preset from local directory
268
+ ccr preset install /path/to/preset
269
+
270
+ # List all installed presets
271
+ ccr preset list
272
+
273
+ # Show preset information
274
+ ccr preset info my-preset
275
+
276
+ # Delete a preset
277
+ ccr preset delete my-preset
278
+ ```
279
+
280
+ **Preset Features:**
281
+ - **Export**: Save your current configuration as a preset directory (with manifest.json)
282
+ - **Install**: Install presets from local directories
283
+ - **Sensitive Data Handling**: API keys and other sensitive data are automatically sanitized during export (marked as `{{field}}` placeholders)
284
+ - **Dynamic Configuration**: Presets can include input schemas for collecting required information during installation
285
+ - **Version Control**: Each preset includes version metadata for tracking updates
286
+
287
+ **Preset File Structure:**
288
+ ```
289
+ ~/.claude-code-router/presets/
290
+ ├── my-preset/
291
+ │ └── manifest.json # Contains configuration and metadata
292
+ ```
293
+
294
+ ### 7. Activate Command (Environment Variables Setup)
259
295
 
260
296
  The `activate` command allows you to set up environment variables globally in your shell, enabling you to use the `claude` command directly or integrate Claude Code Router with applications built using the Agent SDK.
261
297
 
@@ -657,6 +693,10 @@ A huge thank you to all our sponsors for their generous support!
657
693
  - \*勤
658
694
  - \*\*锟
659
695
  - \*涛
696
+ - \*\*明
697
+ - \*知
698
+ - \*语
699
+ - \*瓜
660
700
 
661
701
 
662
702
  (If your name is masked, please contact me via my homepage email to update it with your GitHub username.)
package/README_zh.md CHANGED
@@ -7,13 +7,11 @@
7
7
  <hr>
8
8
 
9
9
  ![](blog/images/sponsors/glm-zh.jpg)
10
- > GLM CODING PLAN 是专为AI编码打造的订阅套餐,每月最低仅需20元,即可在十余款主流AI编码工具如Claude Code、中畅享智谱旗舰模型GLM-4.6,为开发者提供顶尖的编码体验。
10
+ > GLM CODING PLAN 是专为AI编码打造的订阅套餐,每月最低仅需20元,即可在十余款主流AI编码工具如Claude Code、中畅享智谱旗舰模型GLM-4.7,为开发者提供顶尖的编码体验。
11
11
  > 智谱AI为本软件提供了特别优惠,使用以下链接购买可以享受九折优惠:https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII
12
12
 
13
13
  > 一款强大的工具,可将 Claude Code 请求路由到不同的模型,并自定义任何请求。
14
14
 
15
- > [GLM-4.6支持思考及思维链回传](blog/zh/GLM-4.6支持思考及思维链回传.md)
16
-
17
15
  ![](blog/images/claude-code.png)
18
16
 
19
17
 
@@ -205,7 +203,70 @@ ccr ui
205
203
 
206
204
  ![UI](/blog/images/ui.png)
207
205
 
208
- ### 5. Activate 命令(环境变量设置)
206
+ ### 5. CLI 模型管理
207
+
208
+ 对于偏好终端工作流的用户,可以使用交互式 CLI 模型选择器:
209
+
210
+ ```shell
211
+ ccr model
212
+ ```
213
+
214
+ 该命令提供交互式界面来:
215
+
216
+ - 查看当前配置
217
+ - 查看所有配置的模型(default、background、think、longContext、webSearch、image)
218
+ - 切换模型:快速更改每个路由器类型使用的模型
219
+ - 添加新模型:向现有提供商添加模型
220
+ - 创建新提供商:设置完整的提供商配置,包括:
221
+ - 提供商名称和 API 端点
222
+ - API 密钥
223
+ - 可用模型
224
+ - Transformer 配置,支持:
225
+ - 多个转换器(openrouter、deepseek、gemini 等)
226
+ - Transformer 选项(例如,带自定义限制的 maxtoken)
227
+ - 特定于提供商的路由(例如,OpenRouter 提供商偏好)
228
+
229
+ CLI 工具验证所有输入并提供有用的提示来引导您完成配置过程,使管理复杂的设置变得容易,无需手动编辑 JSON 文件。
230
+
231
+ ### 6. 预设管理
232
+
233
+ 预设允许您轻松保存、共享和重用配置。您可以将当前配置导出为预设,并从文件或 URL 安装预设。
234
+
235
+ ```shell
236
+ # 将当前配置导出为预设
237
+ ccr preset export my-preset
238
+
239
+ # 使用元数据导出
240
+ ccr preset export my-preset --description "我的 OpenAI 配置" --author "您的名字" --tags "openai,生产环境"
241
+
242
+ # 从本地目录安装预设
243
+ ccr preset install /path/to/preset
244
+
245
+ # 列出所有已安装的预设
246
+ ccr preset list
247
+
248
+ # 显示预设信息
249
+ ccr preset info my-preset
250
+
251
+ # 删除预设
252
+ ccr preset delete my-preset
253
+ ```
254
+
255
+ **预设功能:**
256
+ - **导出**:将当前配置保存为预设目录(包含 manifest.json)
257
+ - **安装**:从本地目录安装预设
258
+ - **敏感数据处理**:导出期间自动清理 API 密钥和其他敏感数据(标记为 `{{field}}` 占位符)
259
+ - **动态配置**:预设可以包含输入架构,用于在安装期间收集所需信息
260
+ - **版本控制**:每个预设包含版本元数据,用于跟踪更新
261
+
262
+ **预设文件结构:**
263
+ ```
264
+ ~/.claude-code-router/presets/
265
+ ├── my-preset/
266
+ │ └── manifest.json # 包含配置和元数据
267
+ ```
268
+
269
+ ### 7. Activate 命令(环境变量设置)
209
270
 
210
271
  `activate` 命令允许您在 shell 中全局设置环境变量,使您能够直接使用 `claude` 命令或将 Claude Code Router 与使用 Agent SDK 构建的应用程序集成。
211
272
 
@@ -601,6 +662,10 @@ jobs:
601
662
  - \*勤
602
663
  - \*\*锟
603
664
  - \*涛
665
+ - \*\*明
666
+ - \*知
667
+ - \*语
668
+ - \*瓜
604
669
 
605
670
  (如果您的名字被屏蔽,请通过我的主页电子邮件与我联系,以便使用您的 GitHub 用户名进行更新。)
606
671