使用感言

本人使用 OpenCode 进行 AI 辅助开发近 4 个月,觉得非常好用,于是作此分享。

先说说我都给 OpenCode 加装了什么吧:

  • OpenCode 本体 —— 开源终端 AI 编程代理
  • OpenChamber VSCode 扩展 —— 给 OpenCode 加上桌面 / 网页 / 编辑器多端界面
  • OhMyOpencode(现名 oh-my-openagent)—— OpenCode 大整合插件,开箱即用的智能体编排(后台并行 Agent、LSP/AST 工具、Claude Code 兼容层)
  • Opencode-rtk —— 压缩 terminal 输出插件,依赖 RTK,日常命令可省 60%~90% token
  • 一些 skills

快速安装

OpenCode:

推荐通过 npm 全局安装(需先安装 Node.js >= 20.19,也是我当前用的方式):

1
npm install -g opencode-ai

官方也提供免 Node 的安装脚本:curl -fsSL https://opencode.ai/install | bash,按需二选一即可。

OpenChamber:

直接在 VSCode 搜索并安装扩展「OpenChamber」,也可在 VS Code Marketplace 找到。

OhMyOpencode(现名 oh-my-openagent):

插件本体通过 npm 安装,再把它加进 opencode 的插件配置:

1
npm install -g oh-my-openagent

然后在 ~/.config/opencode/opencode.jsonc(或 opencode.json)里启用:

1
2
3
4
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["oh-my-openagent@latest"]
}

Opencode-rtk:

以我使用的 @rezamonangg/opencode-rtk 为例,先装好 RTK 二进制并放进 PATH,再把插件加进配置:

1
2
3
# 1. 安装 RTK 二进制(Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
# 或 brew install rtk
1
2
3
4
5
// ~/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["oh-my-openagent@latest", "@rezamonangg/opencode-rtk"]
}

最后在 ~/.config/opencode/ 下安装插件依赖(npm 方式):

1
2
cd ~/.config/opencode
npm install

阅读文档

使用截图

vscodeOpenChamber

vscode工作界面