> 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/docs/zhong-wen-fan-ti/cherry-studio/preview/code-cli.md).

# 編碼拍檔

【編碼拍檔】用嚟安裝、設定同啟動常見編程命令行工具。Cherry Studio 會識別自己託管嘅安裝，亦會偵測系統登入環境入面已經可用嘅 CLI；系統工具仍然由原本嘅套件管理器維護。

<figure><img src="/files/0ccd884f1a99eeff3dfb7fea3106ccfc9e5e7156" 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/docs/zhong-wen-fan-ti/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.
