Features
- Every session, one list — sessions from every running opencode server on your machine, busiest first, then most recently updated
- Focused by default — shows only busy and recently updated (≤ 2 h) sessions; headless instances always show all their sessions
- Attach with a keystroke —
↵hands the terminal toopencode --server … --session …; quit opencode and you land back in the list - Service, headless and windows — finds the opencode v2 background service, headless instances from the
@kud/mcp-opencoderegistry, and any other opencode server listening locally (found withlsof), shown as windows - Safe stop —
xstops a headless instance after ayconfirmation; the service and windows are never touched - Live state — busy or idle comes from each server's active sessions, and the list refreshes every three seconds
- Two names — installs as
opencode-sessionsand the short aliasocs
Install
Needs opencode v2. v1 servers are not supported; stay on 0.x of this package for those.
npm install -g @kud/opencode-sessions-cliOr run it once with npx @kud/opencode-sessions-cli.
Usage
$ ocsOne row per session: repo, title, state, age, and whether the server is the background service, a headless instance or a window, with its port.
| Key | Action |
|---|---|
↑ ↓ / j k | Move |
↵ | Attach to the session; quitting opencode returns you to the list |
x | Stop a headless instance (asks for y to confirm) |
r | Refresh |
a | Toggle all sessions / recent only |
q | Quit |
Demo flags:
$ ocs --mock
$ ocs --screen list
sessions
$ ocs --screen sessions--mock runs on fixtures with no live data, --screen list prints the screen names, and --screen <name> opens directly on one.