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

@foae/opencode-timings

v0.2.1

Published

OpenCode TUI sidebar panel showing per-session timing: total API/inference time, wall-clock, turns, average and slowest turn. Zero context-window pollution.

Readme

opencode-timings

A tiny OpenCode TUI sidebar plugin that shows per-session timing — how much wall-clock the session has taken and how much of that was actually spent waiting on the model.

It renders into the same right-hand sidebar as the Quota / MCP / LSP / Todo / Files panels, reading the session's messages directly from the TUI's reactive state. Nothing is ever injected into the message stream, so there is zero context-window pollution.

The Timing panel in OpenCode's sidebar — api/wall 34%, api 19s · wall 56s, turns 5 · avg 4s, slowest 6s — sitting between the built-in Quota and LSP sections

Timing
api/wall ██████░░ 78%
api 31s · wall 40s
turns 4 · avg 8s
slowest 19s
per-turn ▄█▂▂

Every row names itself, so there are no unlabeled numbers or glyphs to decode.

Metrics

| Row | Meaning | |------------|---------| | api/wall | How much of wall-clock was actual model inference, as a bar gauge and percent. | | api | Total assistant inference time — the sum of time.completed − time.created over every completed assistant message. | | wall | Span from the first to the last message timestamp. Includes the time you spend reading/typing between turns, so api is always a fraction of it. | | turns | Number of completed assistant messages, plus the average per-turn duration. | | slowest | The single slowest assistant message. | | per-turn | Sparkline of each recent turn's duration. |

The panel is always shown; before the first turn its values read zero.

Install

Add it to the plugin array of the TUI config that OpenCode loads (~/.config/opencode/tui.json or tui.jsonc) — this is a TUI plugin, so it belongs in tui.json, not opencode.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["@foae/opencode-timings@latest"]
}

OpenCode installs the plugin and its dependencies with Bun at startup. Restart OpenCode and open the session sidebar to see the Timing panel.

You can also pin a version, e.g. @foae/[email protected].

Configuration

Pass options using the tuple form ([spec, options]) in tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    ["@foae/opencode-timings@latest", {
      "mode": "fancy",
      "fields": { "ratio": true, "api": true, "wall": true, "turns": true, "avg": true, "slow": true, "sparkline": true }
    }]
  ]
}

| Option | Values | Default | Meaning | |----------|--------|---------|---------| | mode | "fancy" | "simple" | "fancy" | fancy draws the gauge bar on the api/wall row and adds the per-turn sparkline; simple is the same rows without the bar or sparkline. | | fields | object of booleans | all true | Each toggles exactly one value: ratio (the api/wall gauge + percent), api, wall, turns, avg, slow, sparkline (sparkline is fancy-only). Values that share a line drop out individually. |

With no options (a plain "@foae/opencode-timings@latest" string), it defaults to fancy mode with all fields shown.

Requirements

  • OpenCode 1.15.x or newer (uses the TUI slot plugin API).

Development

Built and run with Bun. The package ships raw source — there is no build step; OpenCode loads src/tui.tsx directly.

  • src/timing.ts — pure timing math, formatting, and config parsing (no JSX), unit-tested.
  • src/tui.tsx — the SolidJS sidebar component and the slot registration.
bun install
bun run typecheck   # tsc --noEmit
bun test            # unit tests for the pure logic in src/timing.ts

opentui, solid-js, and the OpenCode plugin/SDK are peer dependencies — at runtime they come from the OpenCode host so the plugin shares its renderer; the devDependencies mirror them for local typecheck and tests.

License

MIT — see LICENSE.