r/opencode • • 3d ago

opencode TUI stopped showing the session and prompt cost, so I developed opencode-usage-insights

A couple of TUI versions ago, it stopped showing the session and last prompt cost, so I decided to go ahead and create my own plugin.
It starts by showing a line on the bottom of the TUI and to the side panel with:
- cost
- tps
- cache reuse

It also includes a complete statistics panel with usage detail through a /usage command.

A keyboard-driven panel over locally recorded telemetry (no prompts or responses stored, nothing leaves your machine). Nine views (overview, models, providers, cache, periods, latency, sessions, turns, db) over five ranges, from this session to all time.

Drill from a model to its providers, a session to its turns, a period to its providers. Sort, filter by model or provider, and it reopens exactly where you left it. Every view sums the same buckets under the same identity (the configured provider plus the model) so a number means the same thing everywhere.

install:
opencode plugin add opencode-usage-insights

Any feedback or contribution would be very welcome.
Thanks!

https://github.com/hugobatista/opencode-usage-insights

1 Upvotes

2 comments sorted by

2

u/mwilson_9309 2d ago

Does the local telemetry database have a clear/reset option? That would give users an easy way to wipe their usage history if they want to.

1

u/pasteldebytes 1d ago

Sure. On the usage panel (/usage or /insights) go to db (9) (or "/usage db"), choose the retention period and click enter. Alternatively, you can run: bun run report --prune 30 --vacuum