0
0
20.0
生态多维模型
18 小时前
2026-10-20
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["herdr-ocx@0.1.2"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["herdr-ocx@0.1.2"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D herdr-ocxOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
OCX-aware Herdr restoration for OpenCode V2. Preserves the selected root conversation, OCX profile, launcher, and explicit OPENCODE_DB value. Deleting the selected conversation clears its saved restore command.
Requires OpenCode V2, OCX 3, and Herdr 0.9.2 or newer. Runs only inside Herdr when launched with an OCX profile.
Install
Install the npm package into an OCX profile:
ocx oc --profile yourprofile plugin add herdr-ocx
plugin add does not disable Herdr's built-in session-selection plugin. In ~/.config/ocx/profiles/<profile>/cli.json, add -herdr.opencode.session-selection to the plugins list (or leave it there if already present). For example:
{
"$schema": "https://opencode.ai/v2/cli.json",
"plugins": [
"-herdr.opencode.session-selection",
{ "package": "herdr-ocx" }
]
}
Preserve your other settings and plugin entries, and don't enable another Herdr session/state reporter alongside this replacement. Restart OpenCode after changing plugins.
Launch normally, for example:
ocx oc --profile personal
ocx oc --profile work
The reporter preserves OPENCODE_DB verbatim. OpenCode resolves relative database overrides against its data directory, not the working directory. Restoration uses ocx oc with the active profile.
Publish
To validate and publish a new version:
npm ci
npm run typecheck
npm publish --dry-run
npm publish
OpenCode loads the exported TypeScript entrypoints directly; no build step is needed.
MIT. See LICENSE.
同类生态推荐
Herdr
opencode-herdr
Route OpenCode agents through Herdr panes as herdr/<adapter>/<model> (Cursor, Claude, Codex, OpenCode)
Herdr Opencode
@phux/herdr-opencode
Native Herdr lifecycle reporting for OpenCode v1 and v2 — accurate agent state and pane session restore
Herdr Opencode
herdr-opencode
Native Herdr lifecycle reporting for OpenCode v1 and v2 — accurate agent state and pane session restore