@musistudio/claude-code-router 1.0.66 → 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 +30 -2
  2. package/README_zh.md +28 -0
  3. package/dist/cli.js +4673 -4542
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -9,11 +9,12 @@
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
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
13
-
12
+ > Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
14
13
 
15
14
  > A powerful tool to route Claude Code requests to different models and customize any request.
16
15
 
16
+ > [GLM-4.6 Supports Reasoning and Interleaved Thinking](blog/en/glm-4.6-supports-reasoning.md)
17
+
17
18
  ![](blog/images/claude-code.png)
18
19
 
19
20
  ## ✨ Features
@@ -254,6 +255,32 @@ This command provides an interactive interface to:
254
255
 
255
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.
256
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
+
257
284
  #### Providers
258
285
 
259
286
  The `Providers` array is where you define the different model providers you want to use. Each provider object requires:
@@ -509,6 +536,7 @@ This setup allows for interesting automations, like running tasks during off-pea
509
536
 
510
537
  - [Project Motivation and How It Works](blog/en/project-motivation-and-how-it-works.md)
511
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)
512
540
 
513
541
  ## ❤️ Support & Sponsoring
514
542
 
package/README_zh.md CHANGED
@@ -12,6 +12,8 @@
12
12
 
13
13
  > 一款强大的工具,可将 Claude Code 请求路由到不同的模型,并自定义任何请求。
14
14
 
15
+ > [GLM-4.6支持思考及思维链回传](blog/zh/GLM-4.6支持思考及思维链回传.md)
16
+
15
17
  ![](blog/images/claude-code.png)
16
18
 
17
19
 
@@ -203,6 +205,32 @@ ccr ui
203
205
 
204
206
  ![UI](/blog/images/ui.png)
205
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
+
206
234
  #### Providers
207
235
 
208
236
  `Providers` 数组是您定义要使用的不同模型提供商的地方。每个提供商对象都需要: