> ## 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/jetbrains/provider-cli.png?fit=max&auto=format&n=kz4nt5KFSKzkAZwe&q=85&s=eab9bf7003e5c4031402aa29cfb17c5a" alt="CLI 檢測頁" width="100%" data-path="images/jetbrains/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` 子程序
* 歷史按執行時隔離
* 增強提示詞與 Commit AI 可走 CLI 一次性提問

## 檢測失敗時

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

## 下一步

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