@johannus22/opencode-tps-meter
v0.1.2
Published
Live tokens-per-second meter with visual bar indicator for OpenCode TUI
Downloads
343
Maintainers
Readme
opencode-tps-meter
A plugin for OpenCode that displays a live Tokens Per Second (TPS) meter with a visual bar indicator in the terminal UI.
Features
- Live TPS display — real-time token generation speed with a 5-second rolling window
- Visual bar indicator — fills proportionally to show performance at a glance
- Color-coded performance:
- 🔴 Red: < 10 TPS (slow)
- 🟡 Yellow: 10-30 TPS (moderate)
- 🟢 Green: 30+ TPS (fast)
- Total tokens counter — running count of tokens streamed in current response
- Elapsed time — live timer since streaming started
- Session summary — shows final TPS and total tokens when streaming completes
Display Format
TPS ▓▓▓▓▓░░░░░ 25.3 | 847 tok | 3.2sInstallation
Via npm
- Add the plugin to your
opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@johannus22/opencode-tps-meter"]
}- Install the package:
cd ~/.opencode
npm install @johannus22/opencode-tps-meterVia local plugin
Copy src/index.tsx to your plugin directory:
.opencode/plugins/— Project-level~/.config/opencode/plugins/— Global
Requirements
- OpenCode >= 1.3.14
- OpenCode TUI (Web UI not supported)
How it works
The plugin hooks into OpenCode's message streaming events:
message.part.delta— tracks token deltas as they arrive from the AI modelmessage.updated— detects completion and shows session summarymessage.part.updated— clears live data when tool calls run- Calculates TPS using a 5-second rolling window
- Estimates tokens using byte-length heuristic (~5 bytes per token)
License
MIT
