Skip to content

upsidedownio/opencode-plugin-nanny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-plugin-nanny

opencode-plugin-nanny is a small opencode TUI plugin that shows delegated subagent status in the TUI sidebar and lets you retry stalled subagents.

Features

  • Adds a Sub-Agents section to the right sidebar in the TUI.
  • Shows the number of discovered subagents as {active}/{total}.
  • Displays a spinner while subagents are running.
  • Marks running subagents as stale with ! after five minutes without updates.
  • Sends a retry prompt only to stale subagent sessions with the <leader>k key binding.

Requirements

  • opencode ^1.15.0
  • Bun

Installation

This plugin provides both an opencode server plugin entrypoint and a TUI plugin entrypoint.

  • opencode.json or opencode.jsonc: read by the opencode server plugin loader.
  • tui.json: read by the opencode TUI loader.

The sidebar UI is a TUI plugin, so it must be registered in tui.json. If you only register it in opencode.json, opencode may start, but the Sub-Agents sidebar will not render.

Install as a package

To use the plugin only in one project, place the config files under that project's .opencode/ directory.

.opencode/opencode.json

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

.opencode/tui.json

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-plugin-nanny"]
}

To use it in every project, add the same entries to your global config files.

  • ~/.config/opencode/opencode.json
  • ~/.config/opencode/tui.json

When the same package name is listed in both files, the opencode server loader selects the package's ./server export and the TUI loader selects the ./tui export.

Install and test from local source

When testing directly from this repository, install dependencies and build first.

bun install
bun run build

To test inside this repository, point .opencode/tui.json at the built output.

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["../dist/tui.js"]
}

To reference this local checkout from another project, use a relative path from the config file location or an absolute file:// URL.

.opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["file:///absolute/path/to/opencode-plugin-nanny/dist/index.js"]
}

.opencode/tui.json

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["file:///absolute/path/to/opencode-plugin-nanny/dist/tui.js"]
}

Usage

  1. Start the opencode TUI.
  2. Open a session where you delegated work with the task tool.
  3. Check the Sub-Agents section in the right sidebar.
  4. When all active subagents have not updated for more than five minutes and ! is shown, press <leader>k to retry only the stale subagents.

The retry command is also registered in the command palette as Retry stale subagents.

Development

bun run build
bun run typecheck
bun run test
  • bun run build: creates dist/index.js, dist/tui.js, and declaration files.
  • bun run typecheck: runs TypeScript type checking.
  • bun run test: runs tests for the subagent status calculation helpers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors