A GUI plugin for OpenCode Desktop (Electron) that adds a Local servers panel to the side region: it lists development servers running on the machine (port, project, process) and opens each one in the browser with a click.
Not to be confused with OpenCode Rune: Rune uses Luau plugins and does not load this package's
gui-experimentalAPI.
- Compact side panel: status indicator, icon, project name (process working directory), port chip and three actions: copy URL, stop and open.
- Clicking a row (or the → button) opens
http://localhost:<port>in the default browser. The copy button uses the app clipboard. - Stop button (only for dev servers with a known PID): asks for confirmation and sends
SIGTERMto the process. The server is only stopped if it is still listening on exactly the same port as the listed PID. - Automatic refresh every 8 seconds, controlled by the Auto switch in the header. It pauses while the window is hidden and reloads once when you return; the Refresh button remains available for manual use.
- Online dev servers are marked only by a green dot on the row; the rest of the card stays neutral, and system ports are dimmed.
- By default it shows only dev servers (port 3000–9999 with a resolved process directory); Show all includes the other listening ports.
- Loading, empty and error states, plus toasts for copy/stop.
- Entry in the side region's
+menu, a button in the panel tab strip and aServers: Nrow in the project menu. - Pill above the composer with dev servers (click opens the URL).
- Palette commands:
Local servers: open panel,Local servers: refreshandLocal servers: stop a server(choose from a list). - Theme-aware visuals: colors derive from
currentColorviacolor-mix; the only green highlight is the status dot, blended into the theme.
Illustrative image with fictional names, ports and commands (no real data):
In the plugin server (RPC local-servers), in this order:
ss -H -ltnplsof -nP -iTCP -sTCP:LISTEN -F pcnnetstat -ltnp
For each PID it reads /proc/<pid>/cwd to find the project folder. If none of these tools is available the list is empty (no error).
The plugin never runs arbitrary commands from the GUI. It only opens validated http(s) URLs and, when you confirm Stop, sends SIGTERM to the PID still listening on the displayed port — never to a system PID, to OpenCode itself, or to a process no longer associated with the current list.
Processes owned by other users (e.g. root) may appear without PID/name because
ss/lsofdo not show that data without privileges. On macOS there is no/proc, so items appear by command name as "other ports".
- Electron-based OpenCode Desktop with
@opencode/plugin/guisupport. - Linux with
ss(iproute2), orlsof/netstatavailable on PATH.
Install from npm:
opencode plugin add @carlosstenzel/opencode-local-serversOr directly from GitHub (npm is not required):
opencode plugin add github:carlosstenzel/opencode-local-serversTo check it:
opencode plugin list
opencode plugin checkOr add it manually to ~/.config/opencode/opencode.json:
{
"plugins": ["@carlosstenzel/opencode-local-servers"]
}The GUI part is the ./gui-experimental export; the dist/gui-experimental.cjs bundle is generated by prepack.
npm install
npm run typecheck
npm run buildWatch rebuild:
npm run devnpm publish --access publicprepack runs typecheck and build before packaging.
MIT — see LICENSE.