> ## 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 一次性提问

## 检测失败时

见 [检测与安装](/jetbrains/providers/cli)。

## 下一步

* [多供应商总览](/jetbrains/providers/overview)
* [发出第一条消息](/jetbrains/start/first-task)
