opencode-agent-intercom-tui
v1.1.0
Published
Visible sidebar panel for opencode-agent-intercom: live subagent list with keyboard navigation, open-session and abort
Downloads
528
Maintainers
Readme
opencode-agent-intercom-tui
Companion TUI plugin for opencode-agent-intercom. Renders a
visible sidebar panel listing the subagents of the current session — status,
context size, age — with keyboard navigation, open-session and abort, plus
input fields to tune the subagent cap and context budget at runtime.
The main opencode-agent-intercom plugin already injects a live subagent
snapshot into the orchestrator's hidden system prompt; that snapshot is only
visible if you ask the orchestrator. This plugin makes the same information
visible on screen, all the time.
How it works
This is a standalone TUI plugin — it does not share memory with the main plugin. It is a first-class client of the opencode server:
api.client.session.children()/.status()/.messages()— discover subagents of the current session, their busy/idle state and context tokens.api.event— react tosession.created/updated/idle/statusandmessage.updated(debounced refresh), with a 5 s poll fallback.api.client.session.abort()— abort a selected subagent. The panel also wakes the orchestrator with an abort notice (promptAsync), since the manual abort bypasses the main plugin's own "wake the primary" path.api.route.navigate("session", { sessionID })— open a subagent's session.
The only shared state with the main plugin is the settings file
~/.config/opencode/agent-intercom.json: the limit inputs write it, the main
plugin reads it live (file > env > default) — no IPC otherwise. Aborts triggered
from the panel are remembered locally (the server status API does not
distinguish "aborted" from "idle").
Interaction
Mouse:
- Click a subagent's name → opens its session (its full transcript — see what it is doing).
- Click the trailing ✕ → aborts that subagent.
- Click the ▼ Subagents header → focuses the panel for keyboard use.
- When the panel is shown inside a subagent's own session, a ← back to orchestrator link appears at the top → click it to return.
- Click the limits
[-]/[+](max subagents±1,max Token(k)±5k tokens) → auto-saves and the main plugin picks it up live.
Keyboard (panel must be focused — Alt+A or click the header):
| Key | Action |
|---|---|
| Alt+A | Focus the subagent panel |
| j / k / arrows | Move selection |
| Enter | Open the selected subagent's session |
| x (or d) | Abort the selected subagent |
| Esc | Unfocus the panel |
Install
TUI plugins are registered in ~/.config/opencode/tui.json (user-global, not
opencode.json):
{
"plugin": ["opencode-agent-intercom-tui"]
}For local iteration, point at the built file directly — opencode does not resolve a TUI plugin from a directory path:
{
"plugin": ["/path/to/opencode-agent-intercom/tui/dist/tui.js"]
}Run npm run build here first, then start the opencode TUI (not serve —
the panel needs a real TUI). The runtime deps (@opentui/*, solid-js,
@opencode-ai/plugin) are provided by opencode and marked external in the
build; they are only devDependencies here for building and typechecking.
Build
npm install
npm run build # tsup → dist/tui.js
npm run typecheck