OpenCode TUI plugin that adds one command: copy the current OpenCode session ID to your clipboard.
Use /opencode-copy-session-id from OpenCode.
The command copies the ID of the session you are currently in. If you run it outside a session (for example from the home screen), it shows a warning instead.
On Linux the plugin copies to the local Wayland clipboard with wl-copy. When OpenCode runs on a machine controlled remotely (for example an Ubuntu host operated from a Mac), set OPENCODE_SESSION_ID_SSH_BRIDGE to user@host (the Mac reaches the clipboard through ssh <bridge> pbcopy). Override the SSH key with OPENCODE_SESSION_ID_SSH_KEY (defaults to ~/.ssh/id_rsa).
Build the package and point OpenCode's global TUI config at the generated file:
npm install
npm run build{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
"file:///Users/you/.config/opencode/tui-plugins/opencode-session-id/dist/index.js"
]
}Restart OpenCode after changing tui.json; TUI plugins are loaded at startup.
Add the published package to your global OpenCode TUI config at ~/.config/opencode/tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
"opencode-session-id"
]
}Restart OpenCode after changing tui.json; TUI plugins are loaded at startup.
npm install
npm run build