@expnn/opencode-server-info
v0.2.0
Published
Downloads
344
Readme
opencode-server-info
An opencode TUI plugin that displays the running opencode server's address (hostname and port) in the sidebar footer, alongside the session directory path and version information.
Preview
Sidebar footer (bottom of the session sidebar):
~/Sources/opencode-server-info
OpenCode 1.17.14 ● localhost:52093The footer replicates opencode's built-in sidebar footer content and appends the server address:
- Getting started banner (conditional) — shown when no external providers are configured
- Directory breadcrumb — abbreviated current working directory, with optional git branch
- Version + server address —
OpenCode {version} ● {hostname}:{port}
Installation
Add the plugin to your ~/.config/opencode/tui.json:
{
"plugin": [
"@expnn/opencode-server-info"
]
}Manual Build
git clone https://github.com/expnn/opencode-server-info
cd opencode-server-info
npm install
npm run buildThe plugin registers on the sidebar_footer slot, which uses single_winner mode. It replaces the built-in footer content entirely and reproduces it with the server address appended.
Server Address Resolution
The server hostname and port are resolved with the following priority chain:
| Priority | Source | Example |
|----------|--------|---------|
| 1 | Internal SDK client baseUrl | http://127.0.0.1:52093 |
| 2 | OPENCODE_HOST env var | http://localhost:4096 (parsed for both hostname and port) |
| 3 | OPENCODE_PORT env var | 52093 (port only) |
| 4 | opencode.json config | server.port / server.hostname |
| 5 | Defaults | localhost:4096 |
The actual runtime URL from the SDK client always takes precedence; environment variables and config values are only consulted when the SDK URL is unavailable. If OPENCODE_HOST is set, both hostname and port are extracted from it. OPENCODE_PORT is used only for the port when OPENCODE_HOST is absent.
Dependencies
@opencode-ai/plugin— TUI plugin API types@opentui/solid— UI component library for opencode TUIsolid-js— Reactive UI framework
Built with tsup and esbuild-plugin-solid.
