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

opencode-go-limits

v0.2.0

Published

OpenCode TUI sidebar widget: opencode Go subscription usage limits (session/weekly/monthly) as bars + percentages

Readme

opencode-go-limits

An OpenCode TUI plugin that shows your opencode Go subscription usage limits in the sidebar — session, weekly, and monthly windows as bars with percentage and reset countdown.

Usage
Session  ██████████ 100% 2h 3m
Weekly   ████░░░░░░ 40%  4d 5h
Monthly  ██░░░░░░░░ 20%  15d 3h
  • Session — the 5-hour rolling window (Xh Xm until reset)
  • Weekly — Xd Xh until reset
  • Monthly — Xd Xh until reset

Bar color goes green → yellow (70%+) → red (90%+ or rate-limited). Data refreshes every 30 seconds.

Requirements

  • OpenCode v1 (≥ 1.3.4) or v2 (≥ 2.0.x). The package declares engines.opencode: "^1.3.4 || ^2.0.0" — v1 hosts before 1.3.4 lack the runtime-module interception the plugin relies on, so they are not supported. The same install works on both versions: the plugin ships a dual-shape entry module that each loader reads its own way.
  • An active opencode Go subscription with opencode auth set up (opencode auth login or /connect in the TUI) — the key is read from auth.json under the opencode-go provider, from the first of:
    • $OPENCODE_DATA_DIR
    • $XDG_DATA_HOME/opencode
    • ~/.local/share/opencode

Tested against: @opencode-ai/[email protected] (v1) and @opencode/[email protected] (v2) types.

Install

opencode v1:

opencode plugin install opencode-go-limits -g

opencode v2:

opencode plugin add opencode-go-limits

or add it manually to ~/.config/opencode/tui.json:

{
  "plugin": ["opencode-go-limits"]
}

Restart OpenCode after installing. The widget appears in the sidebar below the built-in blocks (context, MCP, LSP, todos, files).

How it works

The plugin calls the (undocumented) Go usage endpoint:

GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <api-key>

which returns the percentage used and reset time for each window:

{
  "usage": {
    "rolling":  { "status": "ok", "percent": 98, "resetsAt": "2026-10-07T22:03:52.000Z" },
    "weekly":   { "status": "ok", "percent": 39, "resetsAt": "2026-10-12T00:00:00.000Z" },
    "monthly":  { "status": "ok", "percent": 19, "resetsAt": "2026-10-22T18:11:46.000Z" }
  }
}

The API key is read from auth.json on every fetch, so rotating your key doesn't require a restart. If the fetch fails, a warning with the HTTP status is logged and the widget keeps its last known data; with no key configured, only the header is shown.

Files

| File | Purpose | |---|---| | v1.tsx | OpenCode v1 TUI plugin source: registers the sidebar_content slot and renders the bars | | v2.tsx | OpenCode v2 port: same widget via the v2 setup/slot API (nested theme tokens) | | entry.ts | Dual-shape entry module (id + tui + setup) — what opencode loads from dist/tui.js | | shared.ts | Rendering helpers shared by both implementations (bar, reset countdown) | | usage.ts | Fetch + parse of the usage endpoint (no dependencies) | | build.mjs | Compiles the sources to dist/ with the Babel solid preset | | dist/ | Compiled output — what npm ships and opencode loads |

License

MIT