Merge remote-tracking branch 'origin/dev/3.1' into dev/3.1

This commit is contained in:
musi
2026-07-25 20:01:11 +08:00
36 changed files with 1462 additions and 245 deletions
@@ -2,7 +2,7 @@
title: Agent Profiles
pageTitle: Agent Profiles
eyebrow: Detailed Configuration
lead: Create reusable launch configurations for Claude Code, Codex, Grok CLI, Kimi CLI, and ZCode, and open separate agent instances from different configs.
lead: Create reusable launch configurations for Claude Code, Codex, Grok CLI, Kimi CLI, Pi, and ZCode, and open separate agent instances from different configs.
---
## Configuration Flow
@@ -14,7 +14,7 @@ lead: Create reusable launch configurations for Claude Code, Codex, Grok CLI, Ki
5. If the entry mode includes App, optionally bind a Bot and choose whether to forward agent messages or enable handoff.
6. Save the config, then open it from the Agent Profiles card: the terminal button copies the CLI command, and the play button starts the App instance.
During trial, prefer **Only opened from CCR** and always open the agent from CCR. That keeps the config limited to CCR-launched instances and avoids changing the Claude Code, Codex, Grok CLI, Kimi CLI, or ZCode setup you open directly from the system.
During trial, prefer **Only opened from CCR** and always open the agent from CCR. That keeps the config limited to CCR-launched instances and avoids changing the Claude Code, Codex, Grok CLI, Kimi CLI, Pi, or ZCode setup you open directly from the system.
## Multi-Instance Mechanism
@@ -22,8 +22,8 @@ Every Agent Profiles has its own `id` and name. When CCR opens an agent, it find
| Mechanism | Actual behavior |
| --- | --- |
| Separate config files | With **Only opened from CCR**, Claude Code and Codex write CCR-managed config files in directories separated by config `id` |
| Separate launchers | Claude Code, Grok CLI, and Kimi CLI use separate launch wrappers; Codex and ZCode use separate middleware launchers; filenames are also separated by config `id` or name |
| Separate config files | With **Only opened from CCR**, Claude Code, Codex, OpenCode, Kimi CLI, and Pi write CCR-managed config or home files in directories separated by config `id` |
| Separate launchers | Claude Code, Grok CLI, Kimi CLI, Pi, and OpenCode use separate launch wrappers; Codex and ZCode use separate middleware launchers; filenames are also separated by config `id` or name |
| Separate app data directories | When opening App mode, Claude App, ChatGPT (the renamed Codex desktop app), and ZCode App use user-data directories separated by config `id` |
| Runtime state | CCR tracks running app instances by entry mode and config `id`; reopening the same config activates the existing window, while a different config can open a separate instance |
@@ -33,12 +33,12 @@ This lets you create multiple configs for the same agent, such as "Claude Code -
| Option | Applies to | Description |
| --- | --- | --- |
| Agent | All | Claude Code, Codex, OpenCode, Grok CLI, Kimi CLI, or ZCode. Grok CLI and Kimi CLI support CLI only; ZCode supports App only. |
| Agent | All | Claude Code, Codex, OpenCode, Grok CLI, Kimi CLI, Pi, or ZCode. Grok CLI, Kimi CLI, and Pi support CLI only; ZCode supports App only. |
| Config name | All | Identifies the config in CCR and can be used as the `ccr-app <config-name>` launch target. Names can contain spaces; copied commands are quoted automatically. |
| Enabled | All | Disabled configs are not exposed as active launch entries and are not applied as effective startup configs. |
| Effect scope | All | **Only opened from CCR** uses CCR-managed isolated config; **System default** writes the agent's default config. Only one enabled system-default config is allowed per agent. |
| Entry mode | Claude Code, Codex, OpenCode, Grok CLI, Kimi CLI | `CLI & APP` exposes both CLI and App entry points; `CLI only` only generates a CLI command; `App only` only exposes the App entry point. Grok CLI and Kimi CLI are fixed to `CLI only`. |
| Model | All | Default model for the opened agent, either a provider model or Fusion model. For Claude Code, leaving it empty keeps the Claude Code default. |
| Entry mode | Claude Code, Codex, OpenCode, Grok CLI, Kimi CLI, Pi | `CLI & APP` exposes both CLI and App entry points; `CLI only` only generates a CLI command; `App only` only exposes the App entry point. Grok CLI, Kimi CLI, and Pi are fixed to `CLI only`. |
| Model | All | Default model for the opened agent, either a provider model or Fusion model. Claude Code requires this value. |
| Available models | Kimi CLI | Models exposed by Kimi's `/model` command. The default model is always included. |
| Bot | App entry | Bot forwarding only works for App mode opened from CCR. CLI does not forward Bot messages yet. |
| Environment variables | All | Extra environment variables injected into this config. Claude Code includes `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1` by default so gateway model discovery is enabled. |
@@ -49,8 +49,8 @@ This lets you create multiple configs for the same agent, such as "Claude Code -
| Option | What it does |
| --- | --- |
| Model override | Writes `ANTHROPIC_MODEL` for Claude Code. Leave it empty to keep Claude Code's own default model. |
| Small fast model | Writes `ANTHROPIC_SMALL_FAST_MODEL` for Claude Code lightweight tasks. Leave it empty to keep the Claude Code default. |
| Default model | Required. Writes `ANTHROPIC_MODEL` for Claude Code. |
| Fable / Opus / Sonnet / Haiku models | Writes Claude Code model aliases through `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Leave any alias empty to keep the Claude Code default. Existing `smallFastModel` configs are migrated to the Haiku alias. |
| Settings file | System-default mode uses the Claude Code default settings file; Only opened from CCR creates an isolated settings file under CCR's config directory, separated by Agent Profiles `id`. |
| Environment variables | Merged into the Claude Code settings `env`. CCR also writes the gateway endpoint, API key helper, and launch wrapper. |
| Bot | Applies only to the Claude App entry. Select a saved Bot, then choose message forwarding or handoff. |
@@ -107,6 +107,15 @@ The generated wrapper sets Grok's model base URL and model-list URL to CCR's `/v
Kimi CLI profiles are fixed to **Only opened from CCR** and **CLI only**. Select one default model and one or more available models. The generated wrapper points `KIMI_CODE_HOME` at a profile-specific directory whose `config.toml` defines a private OpenAI-compatible CCR provider and a model entry for every selection. Kimi's `/model` command can therefore switch models without bypassing CCR. CCR preserves non-provider settings from the source config and reuses available sessions, skills, plugins, MCP configuration, and credentials without rewriting the original `~/.kimi-code/config.toml`. If CCR Desktop is not running, the launcher starts a shared temporary gateway and stops it after the last managed Kimi session exits.
### Pi
| Option | What it does |
| --- | --- |
| Pi model | Optional default model passed to Pi. If left empty, CCR uses the first available gateway model. |
| Environment variables | Injected into the Pi wrapper. Use `CCR_PI_BIN` or `PI_BIN` when the real Pi executable is not available as `pi`. CCR manages `PI_CODING_AGENT_DIR`, `PI_CODING_AGENT_SESSION_DIR`, and `PI_SKIP_VERSION_CHECK`. |
Pi profiles are fixed to **Only opened from CCR** and **CLI only**. CCR writes a profile-specific `models.json` under `PI_CODING_AGENT_DIR`, with a provider that uses the local CCR `/v1` gateway as an OpenAI Responses endpoint and the profile-specific CCR API key. The generated wrapper sets `PI_CODING_AGENT_DIR` and `PI_CODING_AGENT_SESSION_DIR`, then launches Pi with `--provider` and `--model` so requests stay routed through CCR. If CCR Desktop is not running, the launcher starts the same shared temporary gateway used by other CLI-only profiles.
### ZCode
| Option | What it does |
@@ -160,6 +169,10 @@ Grok CLI supports CLI only. CCR opens it through a profile-specific wrapper that
Kimi CLI supports CLI only. CCR opens it through a profile-specific wrapper and generated Kimi home containing the selected default model plus every available model. All generated model entries use the CCR gateway and profile API key, so `/model` switches remain routed through CCR; the user's original Kimi configuration remains untouched.
### Pi
Pi supports CLI only. CCR opens it through a profile-specific wrapper, generated `PI_CODING_AGENT_DIR`, and generated `models.json`. The Pi provider uses CCR's OpenAI Responses gateway and the profile API key; the wrapper passes the selected provider and model to the real Pi executable without importing Pi login state.
### ZCode
ZCode supports App only. CCR writes ZCode CLI config, v2 config, and model cache based on ZCode home or a custom config file, then starts the App with the current Agent Profiles's model, provider, and separate user-data directory.
+6 -2
View File
@@ -55,7 +55,7 @@ If you want the overview to show balance or remaining quota, open the provider's
## Connect Agent Profiles
Agent Profiles lets Claude Code, Codex, Grok CLI, ZCode, and other agents use CCR's providers, routing, and model selection.
Agent Profiles lets Claude Code, Codex, Grok CLI, Kimi CLI, Pi, ZCode, and other agents use CCR's providers, routing, and model selection.
General guidance:
@@ -75,13 +75,17 @@ In **Agent Profiles**, choose Codex and confirm Provider ID, Provider Name, mode
Choose Grok CLI and select a default model, then run the copied `ccr-app <profile-name>` command. The command starts a shared temporary gateway service when CCR Desktop is not already serving one; concurrent Grok sessions keep it alive until the last session exits. CCR points Grok model discovery and inference at the local gateway; use `/model` inside Grok to switch CCR models.
### Pi
Choose Pi and optionally select a default model, then run the copied `ccr-app <profile-name>` command. CCR writes a profile-specific `models.json` under `PI_CODING_AGENT_DIR`, registers the local CCR gateway as an OpenAI Responses provider, and launches Pi with the matching `--provider` and `--model` arguments. If CCR Desktop is not running, the launcher can start the same managed temporary gateway used by other CLI-only profiles.
### ZCode
ZCode mainly uses model, Provider ID, Provider Name, and whether it is launched from CCR. It uses the App surface and does not need Codex CLI path fields.
### Reuse A Locally Logged-In Agent
If Claude Code, Codex, Grok CLI, or ZCode is already logged in on this machine, import it as a **Local Agent Provider** from **Providers** to reuse the existing authorization without applying for another key.
If Claude Code, Codex, Grok CLI, Kimi CLI, or ZCode is already logged in on this machine, import it as a **Local Agent Provider** from **Providers** to reuse the existing authorization without applying for another key. Pi profiles do not import Pi login state; they use a generated CCR provider config and CCR profile API key.
## Logs & Observability
@@ -2,7 +2,7 @@
title: Connect Agent Profiles
pageTitle: Connect Agent Profiles
eyebrow: Quick Start
lead: Let Claude Code, Codex, Grok CLI, Kimi CLI, ZCode, and other agents use CCR's providers, routing, and model selection.
lead: Let Claude Code, Codex, Grok CLI, Kimi CLI, Pi, ZCode, and other agents use CCR's providers, routing, and model selection.
---
## General Guidance
@@ -31,10 +31,14 @@ Choose Grok CLI, select a model, and run the copied `ccr-app <profile-name>` com
Choose Kimi CLI, select a default model and one or more available CCR models, then run the copied `ccr-app <profile-name>` command. CCR launches Kimi with a profile-specific `KIMI_CODE_HOME` whose generated `config.toml` registers every selected model against the local CCR gateway. Use `/model` inside Kimi to switch among them. The original `~/.kimi-code/config.toml` is not changed, while sessions, skills, plugins, MCP configuration, and credentials are reused from the source Kimi home when available. The wrapper can also start the same managed temporary gateway when CCR Desktop is not running.
## Pi
Choose Pi, optionally select a default model, and run the copied `ccr-app <profile-name>` command. CCR creates a profile-specific `PI_CODING_AGENT_DIR`, writes a local `models.json` using the CCR gateway as an OpenAI Responses provider, and launches Pi with the generated provider and model arguments. This profile path does not import Pi login state; it uses the CCR profile API key and normal CCR routing.
## ZCode
ZCode mainly uses model, Provider ID, Provider Name, and whether it is launched from CCR. It uses the App surface and does not need Codex CLI path fields.
## Reuse A Locally Logged-In Agent
If Claude Code, Codex, Grok CLI, Kimi CLI, or ZCode is already logged in on this machine, import it as a **Local Agent Provider** from **Providers** to reuse the existing authorization without applying for another key. Kimi CLI imports both managed OAuth logins and API-key providers from `~/.kimi-code/config.toml`.
If Claude Code, Codex, Grok CLI, Kimi CLI, or ZCode is already logged in on this machine, import it as a **Local Agent Provider** from **Providers** to reuse the existing authorization without applying for another key. Kimi CLI imports both managed OAuth logins and API-key providers from `~/.kimi-code/config.toml`. Pi profiles do not import Pi login state; they use a generated CCR provider config and CCR profile API key.
+3 -3
View File
@@ -118,13 +118,13 @@ ccr profile-id -- --help
- `--cli` and `--app` are alternatives to the positional surface.
- Put agent arguments after `--` to avoid ambiguity.
- Claude Code, Codex, and Grok default to CLI; ZCode defaults to App.
- Grok supports CLI only; ZCode supports App only.
- Claude Code, Codex, Grok CLI, Kimi CLI, and Pi default to CLI; ZCode defaults to App.
- Grok CLI, Kimi CLI, and Pi support CLI only; ZCode supports App only.
- Claude App and ZCode App reject trailing agent arguments.
- App launches require a locally installed application and graphical session.
- Only enabled profiles are launchable. Use the profile ID when names are ambiguous.
Most profiles require the CCR gateway to be running. Grok CLI can create a managed temporary shared service and stops it after the final managed Grok session exits.
Most profiles require the CCR gateway to be running. Grok CLI, Kimi CLI, and Pi can create a managed temporary shared service and stop it after the final managed session exits.
## Configuration And Data
+2 -2
View File
@@ -2,7 +2,7 @@
title: Claude Code Router
pageTitle: Documentation
eyebrow: Product Documentation
lead: Use CCR to connect Claude Code, Codex, Grok CLI, ZCode, and compatible API clients to the model providers you choose. If this is your first visit, get one routed request working before diving into routing, Fusion, Bots, and observability.
lead: Use CCR to connect Claude Code, Codex, Grok CLI, Kimi CLI, Pi, ZCode, and compatible API clients to the model providers you choose. If this is your first visit, get one routed request working before diving into routing, Fusion, Bots, and observability.
---
## Get One Routed Request Working
@@ -11,7 +11,7 @@ Start with the shortest successful path:
1. Choose desktop, npm CLI, or Docker from [Install and launch CCR](guides/install/).
2. Open **Providers**, add a preset or custom endpoint, enter an API key, and select at least one model.
3. Open **Agent Profiles**, choose the default model and entry mode for Claude Code, Codex, Grok CLI, or ZCode.
3. Open **Agent Profiles**, choose the default model and entry mode for Claude Code, Codex, Grok CLI, Kimi CLI, Pi, or ZCode.
4. Start the local gateway service. The default endpoint is `http://127.0.0.1:3456`.
5. Send one request from your agent, then open **Logs** to confirm the resolved provider, model, status, tokens, and errors.
@@ -2,7 +2,7 @@
title: Agent 配置档案
pageTitle: Agent 配置档案
eyebrow: 详细配置
lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 创建可复用的启动配置,并通过不同配置打开不同的 Agent 实例。
lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、Pi、ZCode 创建可复用的启动配置,并通过不同配置打开不同的 Agent 实例。
---
## 配置流程
@@ -14,7 +14,7 @@ lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 创建可复用的
5. 如果入口模式包含 App,可以绑定 Bot,并选择是否转发 Agent 消息或开启接力。
6. 保存后,从 Agent 配置档案卡片打开:终端图标会复制 CLI 命令,播放图标会启动 App 实例。
试用阶段建议选择 **仅从 CCR 打开时生效**,并且总是从 CCR 打开 Agent。这样配置只影响 CCR 启动的实例,不会改掉你系统里原本直接打开的 Claude Code、Codex、Grok CLI、Kimi CLI 或 ZCode。
试用阶段建议选择 **仅从 CCR 打开时生效**,并且总是从 CCR 打开 Agent。这样配置只影响 CCR 启动的实例,不会改掉你系统里原本直接打开的 Claude Code、Codex、Grok CLI、Kimi CLI、Pi 或 ZCode。
## 多开机制
@@ -22,8 +22,8 @@ lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 创建可复用的
| 机制 | 实际行为 |
| --- | --- |
| 独立配置文件 | 选择“仅从 CCR 打开时生效”时,Claude CodeCodex 会写入 CCR 管理的独立配置目录,路径按配置 `id` 区分 |
| 独立启动器 | Claude Code、Grok CLIKimi CLI 使用独立启动包装器,Codex 和 ZCode 使用独立中间层启动器,文件名同样按配置 `id` 或名称区分 |
| 独立配置文件 | 选择“仅从 CCR 打开时生效”时,Claude CodeCodex、OpenCode、Kimi CLI 和 Pi 会写入 CCR 管理的独立配置或 home 目录,路径按配置 `id` 区分 |
| 独立启动器 | Claude Code、Grok CLIKimi CLI、Pi 和 OpenCode 使用独立启动包装器,Codex 和 ZCode 使用独立中间层启动器,文件名同样按配置 `id` 或名称区分 |
| 独立 App 数据目录 | 从 App 打开时,Claude App、ChatGPTCodex 桌面端的新名称)、ZCode App 都会使用按配置 `id` 区分的用户数据目录 |
| 运行状态 | CCR 按打开入口和配置 `id` 记录运行中的 App 实例;同一个配置再次打开会激活已有窗口,不同配置可以打开不同实例 |
@@ -33,12 +33,12 @@ lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 创建可复用的
| 选项 | 适用范围 | 说明 |
| --- | --- | --- |
| Agent | 全部 | 选择 Claude Code、Codex、OpenCode、Grok CLI、Kimi CLI 或 ZCode。Grok CLIKimi CLI 只支持 CLIZCode 只支持 App。 |
| Agent | 全部 | 选择 Claude Code、Codex、OpenCode、Grok CLI、Kimi CLI、Pi 或 ZCode。Grok CLIKimi CLI 和 Pi 只支持 CLIZCode 只支持 App。 |
| 配置名称 | 全部 | 用于在 CCR 中识别配置,也会作为 `ccr-app <配置名称>` 的打开目标。名称可以有空格,复制命令时 CCR 会自动加引号。 |
| 启用开关 | 全部 | 关闭后该配置不会出现在打开入口中,也不会被应用为有效启动配置。 |
| 作用范围 | 全部 | **仅从 CCR 打开时生效** 会使用 CCR 管理的独立配置;**系统默认** 会写入对应 Agent 的默认配置。同一个 Agent 同时只能有一个启用的系统默认配置。 |
| 入口模式 | Claude Code、Codex、OpenCode、Grok CLI、Kimi CLI | `CLI & APP` 同时显示 CLI 和 App 打开入口;`CLI only` 只生成 CLI 命令;`App only` 只显示 App 打开入口。Grok CLIKimi CLI 固定为 `CLI only`。 |
| 模型 | 全部 | 该 Agent 打开后的默认模型,可以选择普通供应商模型或 Fusion 模型。Claude Code 留空表示保留 Claude Code 默认模型。 |
| 入口模式 | Claude Code、Codex、OpenCode、Grok CLI、Kimi CLI、Pi | `CLI & APP` 同时显示 CLI 和 App 打开入口;`CLI only` 只生成 CLI 命令;`App only` 只显示 App 打开入口。Grok CLIKimi CLI 和 Pi 固定为 `CLI only`。 |
| 模型 | 全部 | 该 Agent 打开后的默认模型,可以选择普通供应商模型或 Fusion 模型。Claude Code 必须填写该值。 |
| 可用模型 | Kimi CLI | Kimi `/model` 命令中可切换的模型;默认模型始终包含在内。 |
| Bot | App 入口 | 只有从 CCR 打开的 App 模式会转发 Bot 消息。CLI 当前不转发 Bot 消息。 |
| 环境变量 | 全部 | 为该配置注入额外环境变量。Claude Code 默认带 `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1`,用于启用网关模型发现。 |
@@ -49,8 +49,8 @@ lead: 为 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 创建可复用的
| 配置项 | 作用 |
| --- | --- |
| 模型覆盖 | 写入 Claude Code 使用的 `ANTHROPIC_MODEL`留空时不覆盖 Claude Code 自己的默认模型。 |
| 模型 | 写入 `ANTHROPIC_SMALL_FAST_MODEL`,供 Claude Code 的轻量任务使用。留空时保留 Claude Code 默认值。 |
| 默认模型 | 必填。写入 Claude Code 使用的 `ANTHROPIC_MODEL`。 |
| Fable / Opus / Sonnet / Haiku 模型 | 通过 `ANTHROPIC_DEFAULT_FABLE_MODEL``ANTHROPIC_DEFAULT_OPUS_MODEL``ANTHROPIC_DEFAULT_SONNET_MODEL``ANTHROPIC_DEFAULT_HAIKU_MODEL` 写入 Claude Code 模型别名。任一别名留空时保留 Claude Code 默认值;旧的 `smallFastModel` 配置会迁移为 Haiku 别名。 |
| 设置文件 | 系统默认模式使用 Claude Code 默认设置文件;仅从 CCR 打开时生效会在 CCR 配置目录下按 Agent 配置档案 `id` 生成独立设置文件。 |
| 环境变量 | 会合并到 Claude Code 设置文件的 `env` 中。CCR 同时写入网关地址、API Key helper 和启动包装器。 |
| Bot | 只在 Claude App 入口生效,可选择已保存 Bot,并配置转发 Agent 消息或接力。 |
@@ -107,6 +107,15 @@ Grok CLI 配置固定为 **仅从 CCR 打开时生效** 和 **CLI only**。保
Kimi CLI 配置固定为 **仅从 CCR 打开时生效****CLI only**。请选择一个默认模型以及一个或多个可用模型。生成的包装器会把 `KIMI_CODE_HOME` 指向配置专属目录,其中的 `config.toml` 定义私有的 OpenAI 兼容 CCR 供应商,并为每个选中模型生成模型项,因此可在 Kimi 内使用 `/model` 切换且不会绕过 CCR。CCR 会保留来源配置中的非供应商设置,并复用可用的会话、技能、插件、MCP 配置和凭据,不会改写原始 `~/.kimi-code/config.toml`。CCR Desktop 未运行时,启动器会创建共享的临时网关,并在最后一个受管 Kimi 会话退出后停止。
### Pi
| 配置项 | 作用 |
| --- | --- |
| Pi model | 可选的 Pi 默认模型;留空时 CCR 使用第一个可用网关模型。 |
| 环境变量 | 注入 Pi 启动包装器。如果真实 Pi 可执行文件不在 `pi` 命令上,可设置 `CCR_PI_BIN``PI_BIN``PI_CODING_AGENT_DIR``PI_CODING_AGENT_SESSION_DIR``PI_SKIP_VERSION_CHECK` 由 CCR 管理。 |
Pi 配置固定为 **仅从 CCR 打开时生效****CLI only**。CCR 会在配置专属 `PI_CODING_AGENT_DIR` 下写入 `models.json`,其中的供应商使用本地 CCR `/v1` 网关作为 OpenAI Responses 端点,并使用该配置专属 CCR API Key。生成的包装器会设置 `PI_CODING_AGENT_DIR``PI_CODING_AGENT_SESSION_DIR`,然后用 `--provider``--model` 启动 Pi,使请求继续经过 CCR。CCR Desktop 未运行时,该启动器会启动其他 CLI-only 配置共用的受管临时网关。
### ZCode
| 配置项 | 作用 |
@@ -160,6 +169,10 @@ Grok CLI 只支持 CLI。CCR 通过配置专属包装器启动它,注入 CCR
Kimi CLI 只支持 CLI。CCR 通过配置专属包装器和生成的 Kimi home 启动它,其中包含默认模型和所有选中的可用模型。每个模型项都使用 CCR 网关和配置专属 API Key,因此 `/model` 切换后仍经过 CCR;用户原有的 Kimi 配置不会被改写。
### Pi
Pi 只支持 CLI。CCR 通过配置专属包装器、生成的 `PI_CODING_AGENT_DIR` 和生成的 `models.json` 启动它。Pi 供应商使用 CCR 的 OpenAI Responses 网关和配置专属 API Key;包装器会把选中的 provider 和 model 传给真实 Pi 可执行文件,但不会导入 Pi 登录态。
### ZCode
ZCode 只支持 App 打开。CCR 会根据 ZCode home 或自定义配置文件写入 ZCode 的 CLI 配置、v2 配置和模型缓存,并在 App 启动时使用当前 Agent 配置档案的模型、供应商和独立用户数据目录。
+6 -2
View File
@@ -55,7 +55,7 @@ CCR 提供三种发行方式:桌面应用、Node.js 22+ 的 npm CLI,以及 D
## 接入 Agent 配置档案
Agent 配置档案让 Claude Code、Codex、Grok CLI、ZCode 等 Agent 使用 CCR 的供应商、路由和模型选择配置。
Agent 配置档案让 Claude Code、Codex、Grok CLI、Kimi CLI、Pi、ZCode 等 Agent 使用 CCR 的供应商、路由和模型选择配置。
通用建议:
@@ -75,13 +75,17 @@ Agent 配置档案让 Claude Code、Codex、Grok CLI、ZCode 等 Agent 使用 CC
选择 Grok CLI 并设置默认模型,然后运行复制出的 `ccr-app <配置名称>` 命令。即使 CCR Desktop 网关尚未运行,该命令也会启动一个可共享的临时网关服务;并发 Grok 会话会共同保持服务运行,直到最后一个会话退出。CCR 会把 Grok 的模型发现和推理请求指向本地网关;进入 Grok 后可以用 `/model` 切换 CCR 模型。
### Pi
选择 Pi,可选设置默认模型,然后运行复制出的 `ccr-app <配置名称>` 命令。CCR 会在配置专属 `PI_CODING_AGENT_DIR` 下写入 `models.json`,把本地 CCR 网关注册为 OpenAI Responses 供应商,并使用匹配的 `--provider``--model` 参数启动 Pi。CCR Desktop 未运行时,该启动器也可以启动其他 CLI-only 配置共用的受管临时网关。
### ZCode
ZCode 主要关注模型、供应商 ID、供应商名称,以及是否从 CCR 启动。它走 App surface,不需要 Codex CLI 的路径字段。
### 复用本机已登录的 Agent
如果本机已经登录过 Claude Code、Codex、Grok CLI 或 ZCode,可以在 **供应商** 中导入为 **本机 Agent 供应商**,复用已有授权,不必额外申请 Key。
如果本机已经登录过 Claude Code、Codex、Grok CLI、Kimi CLI 或 ZCode,可以在 **供应商** 中导入为 **本机 Agent 供应商**,复用已有授权,不必额外申请 Key。Pi 配置不会导入 Pi 登录态;它使用生成的 CCR 供应商配置和配置专属 CCR API Key。
## 日志&观测
@@ -2,7 +2,7 @@
title: 接入 Agent 配置档案
pageTitle: 接入 Agent 配置档案
eyebrow: 快速开始
lead: 让 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 等 Agent 使用 CCR 的供应商、路由和模型选择配置。
lead: 让 Claude Code、Codex、Grok CLI、Kimi CLI、Pi、ZCode 等 Agent 使用 CCR 的供应商、路由和模型选择配置。
---
## 通用建议
@@ -31,10 +31,14 @@ lead: 让 Claude Code、Codex、Grok CLI、Kimi CLI、ZCode 等 Agent 使用 CCR
选择 Kimi CLI、设置默认模型和一个或多个可用 CCR 模型,然后运行复制出的 `ccr-app <配置名称>` 命令。CCR 会通过配置专属 `KIMI_CODE_HOME` 启动 Kimi,并在其中生成 `config.toml`,把所有选中模型注册到本地 CCR 网关。进入 Kimi 后可使用 `/model` 在这些模型之间切换。用户原有的 `~/.kimi-code/config.toml` 不会被改写;可用时,会继续复用来源 Kimi home 中的会话、技能、插件、MCP 配置和凭据。CCR Desktop 未运行时,该包装器同样可以启动受管的临时网关。
## Pi
选择 Pi,可选设置默认模型,然后运行复制出的 `ccr-app <配置名称>` 命令。CCR 会创建配置专属 `PI_CODING_AGENT_DIR`,写入使用 CCR 网关作为 OpenAI Responses 供应商的本地 `models.json`,并用生成的 provider 和 model 参数启动 Pi。这个配置路径不会导入 Pi 登录态;它使用 CCR 配置专属 API Key 和常规 CCR 路由。
## ZCode
ZCode 主要关注模型、供应商 ID、供应商名称,以及是否从 CCR 启动。它走 App surface,不需要 Codex CLI 的路径字段。
## 复用本机已登录的 Agent
如果本机已经登录过 Claude Code、Codex、Grok CLI、Kimi CLI 或 ZCode,可以在 **供应商** 中导入为 **本机 Agent 供应商**,复用已有授权,不必额外申请 Key。Kimi CLI 支持从 `~/.kimi-code/config.toml` 导入受管 OAuth 登录态和 API Key 供应商。
如果本机已经登录过 Claude Code、Codex、Grok CLI、Kimi CLI 或 ZCode,可以在 **供应商** 中导入为 **本机 Agent 供应商**,复用已有授权,不必额外申请 Key。Kimi CLI 支持从 `~/.kimi-code/config.toml` 导入受管 OAuth 登录态和 API Key 供应商。Pi 配置不会导入 Pi 登录态;它使用生成的 CCR 供应商配置和配置专属 CCR API Key。
+3 -3
View File
@@ -144,13 +144,13 @@ ccr profile-id -- --help
- `--cli``--app` 可以替代位置形式的 `cli` / `app`
- Agent 自己的参数放到 `--` 后,避免与 CCR 选项或入口名冲突。
- 省略入口时,Claude Code、Codex、Grok CLI 默认使用 CLIZCode 默认使用 App。
- Grok 只支持 CLIZCode 只支持 App。
- 省略入口时,Claude Code、Codex、Grok CLI、Kimi CLI、Pi 默认使用 CLIZCode 默认使用 App。
- Grok CLI、Kimi CLI 和 Pi 只支持 CLIZCode 只支持 App。
- Claude App 和 ZCode App 不支持额外 Agent 参数。
- 启动 App 需要本机安装对应桌面应用,并且当前环境有图形会话。
- 只有已启用的配置可以启动。名称产生歧义时使用配置 ID。
大多数配置要求 CCR 网关已经运行。Grok CLI 是例外:如果服务不存在,它可以自动启动一个受管的临时共享服务,并在最后一个 Grok 会话退出后关闭。
大多数配置要求 CCR 网关已经运行。Grok CLI、Kimi CLI 和 Pi 是例外:如果服务不存在,它可以自动启动一个受管的临时共享服务,并在最后一个受管会话退出后关闭。
## 配置和数据位置
+2 -2
View File
@@ -2,7 +2,7 @@
title: Claude Code Router 文档
pageTitle: 文档
eyebrow: 产品文档
lead: 用 CCR 把 Claude Code、Codex、Grok CLI、ZCode 和兼容 API 客户端接到你选择的模型供应商。第一次使用时,先完成一条成功路由请求,再深入路由、Fusion、Bot 和观测。
lead: 用 CCR 把 Claude Code、Codex、Grok CLI、Kimi CLI、Pi、ZCode 和兼容 API 客户端接到你选择的模型供应商。第一次使用时,先完成一条成功路由请求,再深入路由、Fusion、Bot 和观测。
---
## 先完成第一条路由请求
@@ -11,7 +11,7 @@ lead: 用 CCR 把 Claude Code、Codex、Grok CLI、ZCode 和兼容 API 客户端
1. 从[安装并启动 CCR](guides/install/)选择桌面版、npm CLI 或 Docker。
2. 打开 **供应商**,添加预设供应商或自定义端点,填写 API Key,并至少选择一个模型。
3. 打开 **Agent 配置档案**,为 Claude Code、Codex、Grok CLI 或 ZCode 选择默认模型和入口模式。
3. 打开 **Agent 配置档案**,为 Claude Code、Codex、Grok CLI、Kimi CLI、Pi 或 ZCode 选择默认模型和入口模式。
4. 启动本地网关服务,默认端点是 `http://127.0.0.1:3456`
5. 从你的 Agent 发送一次请求,然后在 **日志** 中确认最终供应商、模型、状态、Token 和错误。