npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bojackduy/opencode-herdr-control

v0.1.5

Published

OpenCode plugin for herdr control — survey workspaces/tabs/panes, run shell commands, launch opencode agents

Readme

opencode-herdr-control

OpenCode plugin for herdr control — survey workspaces/tabs/panes, run shell commands, launch opencode agents.

Forked from opencode-herdr (auto-split panes for subagent visibility). This fork diverges: explicit herdr_* tools so agents can create workspaces, interact with shells, and launch OpenCode to work in them.

When the OpenCode orchestrator delegates to a subagent (via the Task tool), this plugin automatically splits a new herdr pane and runs opencode attach inside it, giving you a live TUI view of each subagent's work. Panes close automatically when subagents complete.

Requirements

  • OpenCode ≥ 1.0
  • herdr installed and running
  • OpenCode started with --port flag (required for opencode attach)

Installation

Add @bojackduy/opencode-herdr-control to your opencode.json plugin array:

{
  "plugin": [
    "@bojackduy/opencode-herdr-control"
  ]
}

For local dev: "plugin": ["file:/Users/duytrinh/Code/opencode-herdr"]

Configuration

Create ~/.config/opencode/opencode-herdr-control.json (legacy opencode-herdr.json still works):

| Option | Type | Default | Description | |--------|------|---------|-------------| | splits | boolean | true | Enable/disable automatic pane splitting | | autoClose | boolean | true | Auto-close panes when subagents go idle | | direction | "right" | "down" | "right" | Default split direction for the first subagent |

Example

{
  "splits": true,
  "autoClose": false,
  "direction": "right"
}

With autoClose: false, subagent panes remain open for manual inspection after completion. They still close on session.deleted and session.error events.

Subagent Splits

When a subagent session is created, the plugin:

  1. Splits a herdr pane using a grid layout strategy
  2. Runs opencode attach --session <id> in the new pane
  3. Tracks the session-to-pane mapping
  4. Closes the pane when the subagent finishes (if autoClose is enabled)

Note: OpenCode must be started with --port 0 (or any port) for opencode attach to work. Without this, the plugin will emit a one-time warning and skip all splits.

Prompting a pane agent

herdr_agent_prompt invokes herdr agent prompt <target> <text> and returns the submission acknowledgement by default (wait: false). For a short turn, wait: true adds Herdr's --wait --timeout: it waits for the agent to reach idle, done, or blocked, not for a reply tied to this particular prompt. If the caller's tool run is aborted while waiting, the target may still be working; inspect its pane before considering another submission. Fleet's fleet_exec instead addresses an OpenCode session ID through its own direct/spool transport and waits for a DONE: reply.

How It Works

| Event | Action | |-------|--------| | session.created (with parentID) | Split pane, run opencode attach, store mapping | | session.status → idle (subagent) | Close pane (if autoClose enabled) | | session.deleted | Close pane | | session.error | Close pane |

The plugin is a complete no-op when not running inside herdr (no HERDR_ENV=1).

Grid Layout

The plugin uses a row-based tiling pattern to create a readable grid instead of a single column:

┌──────────┬──────────┐
│ Original │ Agent 0  │  1st: split right from original
│          ├──────────┤
│          │ Agent 1  │  2nd: split down from Agent 0
├──────────┤          │
│ Agent 2  │          │  3rd: split down from original
└──────────┴──────────┘

4th+ agents split right from the appropriate row, cycling through rows.

License

AGPL-3.0-or-later. Fork of opencode-herdr by Gustavo Caiano (MIT) — original notice preserved in LICENSE.