cmux-sidebar-ports is a sidebar plugin for the cmux terminal multiplexer. It shows TCP ports listening on the local machine together with their process names and PIDs. Select a port and press Enter to open http://localhost:<port> in a browser tab in the currently focused cmux pane.
The list refreshes every two seconds. Ports that appeared since the previous refresh are highlighted for one refresh tick, and common development ports from 3000 through 9999 receive a subtle highlight.
The plugin reads lsof -nP -iTCP -sTCP:LISTEN; lsof must be available on macOS or Linux. If it is missing, the sidebar displays an installation hint and keeps running so you can retry with r.
Up/Down,Ctrl-K/Ctrl-J: move the selectionEnter: open the selected port in a cmux browser tabk: ask for confirmation, then sendSIGTERMto the owning processr: refresh immediatelyCtrl-C: exit cleanlyEsc: never exits; cmux owns the focus escape chord
This plugin follows the ordinary-terminal sidebar contract documented by the cmux-sidebar-fzf reference plugin. It reads CMUX_TUI_SOCKET first and accepts the legacy CMUX_MUX_SOCKET fallback, runs in the sidebar PTY, responds to terminal resize events, and reconnects with backoff when the socket is unavailable.
At activation time, the plugin fetches the current cmux tree and targets the currently focused pane. If the connected server has no browser support, the error is shown in the sidebar status line and the plugin continues running.
Run cmux, find its JSON-lines socket path, and pass it to the plugin:
CMUX_TUI_SOCKET=/path/to/cmux-tui.sock cargo runSocket paths commonly follow this convention:
ls "${TMPDIR:-/tmp}"/cmux-tui-*/*.sockRunning without a socket environment variable is supported and renders a helpful reconnect screen instead of panicking.
cmux-tui plugin install https://github.com/manaflow-ai/cmux-sidebar-portscargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo build --release