opencode-worktrunkShow OpenCode session status in worktrunk's wt list output
0
19
近 7 天 5
19.3
生态多维模型
5 个月前
2026-03-10
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-worktrunk@0.2.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-worktrunk@0.2.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-worktrunkopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
See which worktrees have active OpenCode sessions at a glance.
An OpenCode plugin that shows session status markers in worktrunk's wt list output.
What It Does
When you're running OpenCode in a git worktree, this plugin automatically sets status markers that appear in wt list:
$ wt list
Branch Status HEAD± main↕ Remote⇅ Path Commit Age Message
@ main ^⇡ ⇡1 . 33323bc1 1d Initial commit
+ feature-api ↑ 🤖 ↑1 ../repo.feature-api 70343f03 1d Add REST API endpoints
+ review-ui ? ↑ 💬 ↑1 ../repo.review-ui a585d6ed 1d Add dashboard component
+ wip-docs ? – ../repo.wip-docs 33323bc1 1d Initial commit
- 🤖 — OpenCode is working
- 💬 — OpenCode is waiting for input
Prerequisites
- worktrunk must be installed (
cargo install worktrunkorbrew install max-sixty/tap/worktrunk) - OpenCode v0.1.0+
Installation
Via npm (recommended)
Add to your OpenCode config:
// opencode.json or ~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-worktrunk"]
}
Via local plugin
Copy the plugin file to your OpenCode plugins directory:
mkdir -p ~/.config/opencode/plugins
curl -o ~/.config/opencode/plugins/worktrunk.ts \
https://raw.githubusercontent.com/jradtilbrook/opencode-worktrunk/main/src/plugin/index.ts
How It Works
The plugin listens to OpenCode session events:
| Event | Marker | Meaning |
|---|---|---|
session.status (busy) |
🤖 | AI is actively working |
session.idle |
💬 | AI is waiting for your input |
session.deleted |
(cleared) | Session ended |
Markers are stored in git config and persist until cleared. If you close OpenCode without a clean session end (e.g., Ctrl+C), the marker may persist — just run wt config state marker clear to reset it.
Manual Marker Control
You can also set markers manually for any workflow:
wt config state marker set "🚧" # Current branch
wt config state marker set "✅" --branch feature # Specific branch
wt config state marker clear # Clear current branch
wt config state marker clear --all # Clear all markers
Related
- worktrunk — Git worktree manager with status display
- worktrunk Claude Code plugin — Similar integration for Claude Code
License
MIT