Skip to content

SirTenzin/opencode-tps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-tps

A plugin for OpenCode that displays a live Tokens Per Second (TPS) meter in the terminal UI — for the active session AND for every subagent it has spawned.

TPS Meter Demo

What it does

  • Prompt readout — shows TPS <n> on the right side of the prompt for the session you're viewing.
  • Sidebar section — when the current session has one or more subagents, the sidebar grows a TPS section listing the main agent and every subagent alphabetically, each with its live TPS. The section header shows the average TPS across every live agent in the section.
  • The sidebar section is conditionally rendered: if there are no subagents in the current session, nothing is added.

How TPS is calculated:

  • Token deltas are sampled from message.part.delta events on a 5 s rolling window.
  • A reading of - means no tokens have streamed within the last ~1.5 s.
  • Counters clear automatically when streaming completes, errors out, or a tool call starts.

Installation

Via OpenCode CLI

opencode plugin @sirtenzin/opencode-tps

Via npm

  1. Add the plugin to your opencode.json:
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@sirtenzin/opencode-tps"]
}

then

cd ~/.opencode
npm install @sirtenzin/opencode-tps

Requirements

  • OpenCode >= 1.3.14
  • OpenCode TUI (Web UI does not support this plugin)

License

MIT

About

A plugin for OpenCode that displays a live Token Per Second (TPS) meter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%