> ## 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。擴充功能只做檢測，不代裝。

OpenCode 走本機 `opencode`。登入與會話以 OpenCode 自己的配置為準（通常是 `~/.config/opencode/opencode.json`）。

開啟 **設定 → 供應商管理 → CLI**，確認 OpenCode 顯示 **已安裝**。擴充功能**不會**代你安裝，也不會改 `opencode.json`。

<img src="https://mintcdn.com/mossx-docs/kz4nt5KFSKzkAZwe/images/vscode/provider-cli.png?fit=max&auto=format&n=kz4nt5KFSKzkAZwe&q=85&s=5db25777376fb6428e73b4b9c0ae471e" alt="CLI 檢測頁" width="100%" data-path="images/vscode/provider-cli.png" />

## 安裝

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

備選：

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

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

裝好後回到 CLI 頁點 **重新檢測**。找不到命令時，可設 `OPENCODE_BIN` / `OPENCODE_PATH` / `OPENCODE_CLI_PATH`，或把 `~/.opencode/bin` 寫進系統 `PATH`。

## 能力差異

相對 Claude Code：

* 沒有規劃模式
* MCP / Skills / 部分設定頁以 Claude Code 為主
* 停止按鈕會結束 `opencode` 子程序
* 對話可用，但還沒有本地歷史索引；歷史檢視不會列出 OpenCode 會話

## 檢測失敗時

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

## 下一步

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