1
34
近 7 天 4
30.0
生态多维模型
1 个月前
2026-07-10
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-advisor@0.1.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-advisor@0.1.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-plugin-advisoropencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
An opencode plugin that gives the agent a second opinion.
It registers one tool, advisor, which the agent calls to consult a separate,
user-chosen model before acting. The advisor model has read-only tools
(read/grep/glob/webfetch) — it can look things up, but it can never edit
files, run commands, or spawn subtasks.
It also registers a /advise [question] slash command (via the plugin's
config hook — no separate command file needed) so you can trigger it
explicitly at any time.
When the agent calls it
- The change is big, risky, hard to reverse, or involves many blocking/destructive operations.
- Exploration is done and it has a concrete solution but wants feedback before implementing.
- You explicitly ask it to get advice, a second opinion, or check its approach.
Install
Add the plugin to your opencode config (global ~/.config/opencode/opencode.json
or a project's opencode.json):
{
"plugin": ["opencode-plugin-advisor"]
}
Or, while developing locally, point at the file directly:
{
"plugin": ["file:///absolute/path/to/advisor/index.ts"]
}
Restart opencode after changing config.
Configure the advisor model
Copy advisor.example.json to advisor.json and set the model you want to
consult. The plugin looks in, in order:
<project>/advisor.json~/.config/opencode/advisor.json
{
"model": "anthropic/claude-fable-5"
}
Optional fields:
system— override the default advisor system prompt.tools— override the default tool permissions ({ "write": false, ... }).
Development
bun install
bunx tsc --noEmit