Skip to content

About

Sidebar plugins for the OpenCode TUI: system monitor, usage limits, frames, agent and shell panels

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-sidebar

Sidebar plugins for the OpenCode TUI: a live system monitor, OpenCode Go usage limits, tab/sidebar frames, and panels for subagents and shells.

No dependencies, no build step. OpenCode compiles the TSX plugins itself.

Preview

OpenCode sidebar with the Limits, System, Agents and Shells sections

The │ separators between tabs and the frames around sidebar titles come from the chrome plugin.

The second GPU row is an integrated GPU. It appears only while the APU is not in runtime suspend, so a dGPU-only machine shows a single row. In PWR the third number is the iGPU package power.

Plugins

Directory Plugin id What it draws
plugins/panel user.panel System (CPU, RAM/swap, GPU, iGPU, power, network), Cache (off by default), Agents (child sessions, click to open), Shells (click to toggle the terminal)
plugins/chrome user.chrome Tab separators, a frame around the sidebar title, and colored frames for sections that register an accent
plugins/limits user.limits OpenCode Go allowance (5h / week / month) in the sidebar, plus a Limits · wk 42% badge in the footer when the terminal is narrow

Section order in the sidebar follows the directory name: chrome → limits → panel.

Requirements

  • Linux. The panel reads /proc/stat, /proc/meminfo, /sys/class/hwmon, /sys/class/drm, /sys/class/net and /sys/class/powercap.
  • A TUI OpenCode release with sidebar slots. Tested with 2.3.2.
  • AMD GPU telemetry (busy %, VRAM, temperature, power) comes from the amdgpu driver. Other vendors are not handled yet.
  • limits needs OpenCode Go credentials in the credential store. Without them the block shows not signed in.

Install

git clone https://github.com/YaBulochka/opencode-sidebar.git
cp -r opencode-sidebar/plugins/* ~/.config/opencode/plugins/

Restart OpenCode. Plugins are loaded when the TUI client starts.

For development, symlink instead of copying (remove an existing copy first):

ln -s "$(pwd)/opencode-sidebar/plugins/panel" ~/.config/opencode/plugins/panel

Configuration

Panel sections are toggled at the top of plugins/panel/tui.tsx:

const SECTIONS = {
  system: true,
  cache: false,
  agents: true,
  shells: true,
}

The Cache block is disabled by default: it reports hit rate, cache reads/writes, cost and tokens per second for the current session.

How the numbers are read

  • CPU — cpu line in /proc/stat between samples, temperature from k10temp.
  • RAM / swap — MemTotal, MemAvailable, SwapTotal, SwapFree.
  • GPU / iGPU — one DRM card per GPU from /sys/class/drm, matched to its own hwmon by PCI device so two amdgpu sensors never get mixed up. The integrated GPU is detected by the missing mem_info_vram_vendor: APUs borrow system RAM, so their memory is reported through GTT instead of VRAM.
  • PWR — package energy from RAPL (/sys/class/powercap) for the CPU, power1_average (or power1_input) for the GPUs.
  • NET — summed rx_bytes/tx_bytes over physical interfaces, excluding loopback, container and VPN devices.

Caveats

The TUI plugin surface is not stable. These plugins use the host alias @opencode/plugin/tui, context.renderer.postProcessFns (chrome) and @opentui/* primitives, so a future OpenCode release may break them. Pin or vendor the versions you rely on.

chrome reaches into the rendered tree to find the tab strip and the sidebar frame. It is a post-process pass over the frame buffer, not an official layout API; a host layout change can make it draw nothing or draw in the wrong place.

License

MIT

About

Sidebar plugins for the OpenCode TUI: system monitor, usage limits, frames, agent and shell panels

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages