跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    jradtilbrook

    Worktrunk

    v0.2.1Git 与版本控制
    opencode-worktrunk

    Show OpenCode session status in worktrunk's wt list output

    GitHub 星标

    0

    月装机量

    19

    近 7 天 5

    综合评分SCORE

    19.3

    生态多维模型

    最近提交

    5 个月前

    2026-03-10

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-worktrunk@0.2.1"]
    }

    opencode 启动时会通过内嵌运行时自动加载 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 worktrunk or brew 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

    License

    MIT