npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@esuyo/esuyo-opencode-tks

v0.1.2

Published

Live TPS, average TPS, average TTFT, and response GAP metrics for OpenCode sessions, with optional JSONL stats logging.

Readme

esuyo-opencode-tks

Displays live TPS (tokens per second), average TPS, average TTFT (time to first token), and GAP (time between the end of the previous assistant response and the start of the next one) in the OpenCode session prompt. Optionally appends per-message stats as JSONL for later analysis.

TPS 62.4 | AVG 58.1 | TTFT 0.9s | GAP 12.3s

Demo

Installation

Install from the CLI:

opencode plugin @esuyo/esuyo-opencode-tks@latest --global

Requires opencode 1.3.14 or newer.

If you previously installed the upstream oc-tps, uninstall it first so both plugins do not register the same slot:

opencode plugin oc-tps --global --uninstall

Metrics

| Metric | Meaning | | --- | --- | | TPS | Live tokens/sec over the last 5s streaming window. | | AVG | Session-average tokens/sec across completed assistant messages. | | TTFT | Session-average time from request start to first token. | | GAP | Time between the previous final assistant completion and this message's start, including user think-time. Shows - for the first message. |

GAP is measured between final completions only; intermediate finish: "tool-calls" chunks do not reset the baseline.

File logging

Every completed assistant message is appended as one JSON object per line (JSONL). No prompt or response text is ever written — numeric metadata only.

Default path:

~/.local/share/opencode/esuyo-opencode-tks.log

Override with an environment variable:

export ESUYO_TPS_LOG=/path/to/tps.log

Disable logging by pointing it at /dev/null:

export ESUYO_TPS_LOG=/dev/null

Schema (v1)

{
  "v": 1,
  "at": "2026-09-11T23:50:00.000Z",   // completion wall-time
  "sessionID": "ses_...",
  "messageID": "msg_...",
  "finish": "stop",                    // "stop" | "tool-calls" | ...
  "tokensOutput": 123,
  "tokensReasoning": 45,
  "tokensTotal": 168,
  "durationMs": 2345,                  // first response -> end
  "ttftMs": 456,                       // request start -> first response
  "gapMs": 12340,                      // previous completion -> this start (null on first)
  "avgTps": 71.6,
  "liveSamplesDropped": false
}

Log writing is best-effort: I/O errors are swallowed so the TUI never crashes.

Rotation

v1 does not rotate the log. Use logrotate, for example:

/root/.local/share/opencode/esuyo-opencode-tks.log {
    weekly
    rotate 4
    compress
    missingok
    notifempty
    copytruncate
}

Development

npm install
npm run typecheck
npm test

Credits & license

Forked from Tarquinen/oc-tps at commit 89bf5b8 (v0.0.10). The upstream project declared no license; original work remains attributed to its author. See NOTICE and LICENSE (MIT).