> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mossx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> 配置 OpenCode CLI、本地 opencode.json 或第三方供應商。

OpenCode 走本機 `opencode`。開啟 **設定 → CLI配置管理 → OpenCode CLI** 檢測版本、安裝，並配置憑證。

## 接入方式

1. **使用本地配置**：直接讀 `~/.config/opencode/opencode.json`（也支援 `.jsonc`）。優先讀 `$OPENCODE_CONFIG`
2. **新增供應商**：名稱、Base URL、API Key、模型列表
3. 可覆蓋 `opencode` 可執行檔案路徑
4. 可把該引擎放到 **未啟用**，輸入框裡就不再出現
5. 未安裝時在該頁點 **安裝**，或按下面的終端命令安裝

OpenCode 的託管供應商走環境注入，**不會改** `opencode.json`。登入與會話仍以 OpenCode 自己的配置為準。

<Note>
  配置只存在你的電腦上。客戶端不會把 Key 上傳到 CC GUI 自己的伺服器。
</Note>

## 新增供應商

點 **新增**，填：

* 名稱、Base URL、API Key
* 模型列表（逗號分隔；留空則不限制）
* 可選：備註

快捷預設：OpenCode Zen（官方）。

## 安裝

```bash theme={null}
curl -fsSL https://opencode.ai/install | bash
opencode --version
```

備選：

```bash theme={null}
npm install -g opencode-ai
```

應用內 **安裝** 預覽的是備選裡的 `npm install -g opencode-ai`。客戶端不提供 OpenCode 解除安裝，以免誤刪登入與會話資料。

文件：[https://opencode.ai/docs/](https://opencode.ai/docs/)

## 能力差異

相對 Claude Code：

* 沒有規劃模式
* 不走客戶端 MCP
* 支援會話續寫與圖片輸入
* 停止按鈕會結束 `opencode` 子程序
* 歷史按 runtime 隔離

## 檢測失敗時

見 [檢測與安裝](/zh-Hant/desktop/providers/cli)。

## 下一步

* [多供應商總覽](/zh-Hant/desktop/providers/overview)
* [發出第一條訊息](/zh-Hant/desktop/start/first-task)
