Context Tree
Pi-style context tree for OpenCode: branch, merge (human-confirmed decision records), crop, undo, plus a DeepSeek-Harness-style trajectory view
4
近 30 天 +1
1,313
近 7 天 36
46.5
生态多维模型
14 天前
2026-09-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-context-tree@0.3.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-context-tree@0.3.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-context-treeOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
A monorepo of independently versioned and published OpenCode
plugins. Each publishable package lives under packages/<name>/ with its own
package.json, README, and release history; the root only holds shared tooling
(TypeScript base config, the harness/ PTY test rig) and CI.
| Package | Description |
|---|---|
packages/context-tree |
Pi-style context tree for OpenCode: branch, merge, crop, undo, plus a trajectory view |
packages/git-stats |
Sidebar card: working-tree diff figures, plus a GitHub-coloured chip per pull request the session touched |
Adding a plugin
- Create
packages/<name>/with its ownpackage.jsonand release scripts, and add it to theworkflow_dispatch.inputs.packagechoice list in.github/workflows/release.ymlandpublish.yml. - Publish its first version by hand. npm's trusted publishing cannot be set up
for a package that does not exist yet — the trust record silently fails to attach
and the exchange reports "package not found". From
packages/<name>/:npm version <v> --no-git-tag-version --ignore-scripts && bun run build && npm publish --access public --ignore-scripts, then reset the version (git checkout -- package.json) since the tag is the source of truth.--ignore-scriptsis required: npm chokes on theworkspace:*specifiers inside@opentui's own published metadata, which is also why the build is explicit rather than left toprepack. - Then create the trust record, once per package — it binds to the package, not
the repo, so a second plugin needs its own:
npm trust github <pkg> --file publish.yml --repo navbytes/opencode-plugins, with environmentnpm(the publish job declares one; a record without it will not match the OIDC claims). - After that,
gh workflow run release.yml -f package=<name> -f bump=patchdoes the rest. Notebump=computes off the newest<name>-v*tag and ignores a prerelease suffix, so the release a beta anticipated must be cut with an explicit-f version=, notbump=.
A green release.yml only means it tagged and dispatched, and a green publish.yml
only means npm accepted the upload — the registry lags by a minute or two. Check the
registry, not the workflow.
Development
bun install
bun run build # builds every package
bun run typecheck # typechecks every package
bun test # runs every package's tests
同类生态推荐
Dir Tree Tui
opencode-dir-tree-tui
OpenCode V2 TUI plugin: VS Code-style file tree in the sidebar with git status coloring and click-to-open
Review
@opencode-cockpit/review
A pull request in the terminal: read the diff, hold your notes, send one review
Pr Tracker
@kitlangton/opencode-pr-tracker
Session-aware pull request tracking for the OpenCode V2 TUI