> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/cherry-studio/preview/code-cli.md).

# 编码搭档

【编码搭档】用于安装、配置和启动常见编程命令行工具。Cherry Studio 会识别自己的托管安装，也会检测系统登录环境中已经可用的 CLI；系统工具仍由原来的包管理器维护。

<figure><img src="/files/jnCswa5shE1MtTN7VLU8" alt="编码搭档页面中的安装状态、版本检查和 Code CLI 提供方"><figcaption><p>先确认工具已经安装且版本可用，再配置模型连接和项目目录。</p></figcaption></figure>

## 页面能做什么

* 检查工具是否安装以及是否有可用更新；
* 安装或更新 Cherry Studio 托管的工具副本；
* 检测系统 PATH 中已有的工具；
* 为需要模型服务的 CLI 选择服务商和模型；
* 为使用自身账号登录的 CLI 保留原生登录方式；
* 选择工作目录和系统检测到的终端后启动。

页面当前包含 Claude Code、OpenAI Codex、Gemini CLI、OpenCode、Qwen Code、Kimi Code、Qoder CLI 和 GitHub Copilot CLI 等工具。实际可见项会随产品更新变化，以页面列表为准。

## 使用流程

{% stepper %}
{% step %}

### 1. 打开左侧导航【编码搭档】

选择需要的工具，先看状态是未安装、由 Cherry Studio 托管，还是来自系统。
{% endstep %}

{% step %}

### 2. 完成安装或登录

未安装时点击【安装】。由工具自身提供账号登录的 CLI，按照页面提示完成原生登录，不需要从 Cherry Studio 选择服务商。
{% endstep %}

{% step %}

### 3. 配置模型连接

需要 Cherry Studio 模型服务的工具，选择兼容的服务商和模型。页面会按 CLI 所需的接口类型筛选，不兼容的服务商不会列出。
{% endstep %}

{% step %}

### 4. 选择目录和终端

工作目录决定 CLI 启动位置。终端只能从系统检测到的列表中选择；自定义终端可执行文件路径不再提供。
{% endstep %}

{% step %}

### 5. 启动并验证

点击【启动】，在终端中运行一个只读检查。确认账号、模型和目录正确后再执行文件修改或命令。
{% endstep %}
{% endstepper %}

## Claude Code 的模型模式

配置 Claude Code 时，【模型】提供两种模式：

* 【通用】：所有请求使用同一个模型，配置简单；
* 【详细】：在【模型角色映射】中分别设置 Fable、Opus、Sonnet、Haiku 和 Subagent。表格里的【实际请求模型】就是每个角色最终使用的模型；需要时还可为对应角色开启【1M】上下文。

只有确实需要为后台子任务、压缩或标题等角色指定不同模型时，才使用【详细】。留空的角色会跟随主模型。修改后先用一个小任务确认每个角色都能正常请求。

## 使用场景：在项目目录启动编码工具

| 选择    | 建议起点                          | 适用场景         | 注意事项             |
| ----- | ----------------------------- | ------------ | ---------------- |
| 安装来源  | 已有系统版本就先使用系统版本                | 团队已经统一管理 CLI | 更新和卸载仍由原包管理器负责   |
| 模型连接  | 先选一个已经在 Cherry Studio 验证可用的连接 | 需要模型服务的 CLI  | 自带账号登录的工具按原生流程登录 |
| 工作目录  | 只选择当前项目目录                     | 修改代码、运行检查    | 启动后先确认终端所在路径     |
| 第一次命令 | 只读查看项目状态                      | 验证账号、模型和目录   | 确认无误后再允许写文件      |

### 完成标准

页面能识别安装来源；终端在正确目录打开；最小只读命令成功；工具显示的账号或模型与预期一致。

## 安装来源要分清

| 来源               | Cherry Studio 会做什么 | 你应该如何维护            |
| ---------------- | ------------------ | ------------------ |
| Cherry Studio 托管 | 安装、更新和卸载对应托管副本     | 在【编码搭档】或【环境依赖】中管理  |
| 系统 PATH          | 检测并直接使用，不覆盖        | 用原包管理器更新或卸载        |
| 应用内置             | 直接使用，不提供系统级卸载      | 随 Cherry Studio 更新 |

{% hint style="warning" %}
卸载 Cherry Studio 托管副本后，如果系统中还有同名可执行文件，页面会自动回退到系统版本。版本或行为变化时，先确认当前使用的是哪一种来源。
{% endhint %}

<details>

<summary>为什么找不到已经安装的终端或 CLI？</summary>

Cherry Studio 从登录环境和标准位置检测工具。确认命令在登录终端中可运行，然后重启应用刷新环境。便携式或非标准路径目前需要从该终端手动启动。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/cherry-studio/preview/code-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
