@musistudio/claude-code-router 1.0.65 → 1.0.67

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 (4) hide show
  1. package/README.md +33 -6
  2. package/README_zh.md +31 -6
  3. package/dist/cli.js +5102 -4944
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -6,18 +6,17 @@
6
6
 
7
7
  <hr>
8
8
 
9
- > I am currently seeking **Agent development related job opportunities**, either **based in Hangzhou** or **remote**. If you are interested in my projects or have suitable opportunities, feel free to reach out! 📧 Email: m@musiiot.top
9
+ ![](blog/images/sponsors/glm-en.jpg)
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.
12
+ > Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
10
13
 
11
14
  > A powerful tool to route Claude Code requests to different models and customize any request.
12
15
 
13
- > Now you can use models such as `GLM-4.5`, `Kimi-K2`, `Qwen3-Coder-480B-A35B`, and `DeepSeek v3.1` for free through the [iFlow Platform](https://platform.iflow.cn/docs/api-mode).
14
- > You can use the `ccr ui` command to directly import the `iflow` template in the UI. It’s worth noting that iFlow limits each user to a concurrency of 1, which means you’ll need to route background requests to other models.
15
- > If you’d like a better experience, you can try [iFlow CLI](https://cli.iflow.cn).
16
+ > [GLM-4.6 Supports Reasoning and Interleaved Thinking](blog/en/glm-4.6-supports-reasoning.md)
16
17
 
17
18
  ![](blog/images/claude-code.png)
18
19
 
19
- ![](blog/images/roadmap.svg)
20
-
21
20
  ## ✨ Features
22
21
 
23
22
  - **Model Routing**: Route requests to different models based on your needs (e.g., background tasks, thinking, long context).
@@ -256,6 +255,32 @@ This command provides an interactive interface to:
256
255
 
257
256
  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.
258
257
 
258
+ ### 6. Activate Command (Environment Variables Setup)
259
+
260
+ 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
+
262
+ To activate the environment variables, run:
263
+
264
+ ```shell
265
+ eval "$(ccr activate)"
266
+ ```
267
+
268
+ This command outputs the necessary environment variables in shell-friendly format, which are then set in your current shell session. After activation, you can:
269
+
270
+ - **Use `claude` command directly**: Run `claude` commands without needing to use `ccr code`. The `claude` command will automatically route requests through Claude Code Router.
271
+ - **Integrate with Agent SDK applications**: Applications built with the Anthropic Agent SDK will automatically use the configured router and models.
272
+
273
+ The `activate` command sets the following environment variables:
274
+
275
+ - `ANTHROPIC_AUTH_TOKEN`: API key from your configuration
276
+ - `ANTHROPIC_BASE_URL`: The local router endpoint (default: `http://127.0.0.1:3456`)
277
+ - `NO_PROXY`: Set to `127.0.0.1` to prevent proxy interference
278
+ - `DISABLE_TELEMETRY`: Disables telemetry
279
+ - `DISABLE_COST_WARNINGS`: Disables cost warnings
280
+ - `API_TIMEOUT_MS`: API timeout from your configuration
281
+
282
+ > **Note**: Make sure the Claude Code Router service is running (`ccr start`) before using the activated environment variables. The environment variables are only valid for the current shell session. To make them persistent, you can add `eval "$(ccr activate)"` to your shell configuration file (e.g., `~/.zshrc` or `~/.bashrc`).
283
+
259
284
  #### Providers
260
285
 
261
286
  The `Providers` array is where you define the different model providers you want to use. Each provider object requires:
@@ -511,6 +536,7 @@ This setup allows for interesting automations, like running tasks during off-pea
511
536
 
512
537
  - [Project Motivation and How It Works](blog/en/project-motivation-and-how-it-works.md)
513
538
  - [Maybe We Can Do More with the Router](blog/en/maybe-we-can-do-more-with-the-route.md)
539
+ - [GLM-4.6 Supports Reasoning and Interleaved Thinking](blog/en/glm-4.6-supports-reasoning.md)
514
540
 
515
541
  ## ❤️ Support & Sponsoring
516
542
 
@@ -625,5 +651,6 @@ A huge thank you to all our sponsors for their generous support!
625
651
  - [@苗大](https://github.com/WitMiao)
626
652
  - @\*呢
627
653
  - @\d*u
654
+ - @crizcraig
628
655
 
629
656
  (If your name is masked, please contact me via my homepage email to update it with your GitHub username.)
package/README_zh.md CHANGED
@@ -6,18 +6,16 @@
6
6
 
7
7
  <hr>
8
8
 
9
- > 我目前正在寻找 **Agent 开发相关的工作机会**,可 base 在 **杭州**,也接受 **远程** 合作。如果你对我的项目感兴趣,或有合适的岗位/合作机会,欢迎联系我! 📧 Email: m@musiiot.top
9
+ ![](blog/images/sponsors/glm-zh.jpg)
10
+ > GLM CODING PLAN 是专为AI编码打造的订阅套餐,每月最低仅需20元,即可在十余款主流AI编码工具如Claude Code、中畅享智谱旗舰模型GLM-4.6,为开发者提供顶尖的编码体验。
11
+ > 智谱AI为本软件提供了特别优惠,使用以下链接购买可以享受九折优惠:https://www.bigmodel.cn/claude-code?ic=RRVJPB5SII
10
12
 
11
13
  > 一款强大的工具,可将 Claude Code 请求路由到不同的模型,并自定义任何请求。
12
14
 
13
- > 现在你可以通过[心流平台](https://platform.iflow.cn/docs/api-mode)免费使用`GLM-4.5`、`Kimi-K2`、`Qwen3-Coder-480B-A35B`、`DeepSeek v3.1`等模型。
14
- > 你可以使用`ccr ui`命令在UI中直接导入`iflow`模板,值得注意的是心流限制每位用户的并发数为1,意味着你需要将`background`路由到其他模型。
15
- > 如果你想获得更好的体验,可以尝试[iFlow CLI](https://cli.iflow.cn)。
15
+ > [GLM-4.6支持思考及思维链回传](blog/zh/GLM-4.6支持思考及思维链回传.md)
16
16
 
17
17
  ![](blog/images/claude-code.png)
18
18
 
19
- ![](blog/images/roadmap.svg)
20
-
21
19
 
22
20
  ## ✨ 功能
23
21
 
@@ -207,6 +205,32 @@ ccr ui
207
205
 
208
206
  ![UI](/blog/images/ui.png)
209
207
 
208
+ ### 5. Activate 命令(环境变量设置)
209
+
210
+ `activate` 命令允许您在 shell 中全局设置环境变量,使您能够直接使用 `claude` 命令或将 Claude Code Router 与使用 Agent SDK 构建的应用程序集成。
211
+
212
+ 要激活环境变量,请运行:
213
+
214
+ ```shell
215
+ eval "$(ccr activate)"
216
+ ```
217
+
218
+ 此命令会以 shell 友好的格式输出必要的环境变量,这些变量将在当前的 shell 会话中设置。激活后,您可以:
219
+
220
+ - **直接使用 `claude` 命令**:无需使用 `ccr code` 即可运行 `claude` 命令。`claude` 命令将自动通过 Claude Code Router 路由请求。
221
+ - **与 Agent SDK 应用程序集成**:使用 Anthropic Agent SDK 构建的应用程序将自动使用配置的路由器和模型。
222
+
223
+ `activate` 命令设置以下环境变量:
224
+
225
+ - `ANTHROPIC_AUTH_TOKEN`: 来自配置的 API 密钥
226
+ - `ANTHROPIC_BASE_URL`: 本地路由器端点(默认:`http://127.0.0.1:3456`)
227
+ - `NO_PROXY`: 设置为 `127.0.0.1` 以防止代理干扰
228
+ - `DISABLE_TELEMETRY`: 禁用遥测
229
+ - `DISABLE_COST_WARNINGS`: 禁用成本警告
230
+ - `API_TIMEOUT_MS`: 来自配置的 API 超时时间
231
+
232
+ > **注意**:在使用激活的环境变量之前,请确保 Claude Code Router 服务正在运行(`ccr start`)。环境变量仅在当前 shell 会话中有效。要使其持久化,您可以将 `eval "$(ccr activate)"` 添加到您的 shell 配置文件(例如 `~/.zshrc` 或 `~/.bashrc`)中。
233
+
210
234
  #### Providers
211
235
 
212
236
  `Providers` 数组是您定义要使用的不同模型提供商的地方。每个提供商对象都需要:
@@ -571,6 +595,7 @@ jobs:
571
595
  - [@苗大](https://github.com/WitMiao)
572
596
  - @\*呢
573
597
  - @\d*u
598
+ - @crizcraig
574
599
 
575
600
 
576
601
  (如果您的名字被屏蔽,请通过我的主页电子邮件与我联系,以便使用您的 GitHub 用户名进行更新。)