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

@joserdf/opencode-usage-sidebar

v0.2.2

Published

OpenCode plugin that displays Claude/Codex/Copilot usage limits in the TUI sidebar, powered by usage-tui (Linux fork of opencode-limits-sidebar).

Readme

opencode-usage-sidebar

OpenCode TUI plugin that displays Claude / Codex / Copilot usage limits in the right sidebar, powered by usage-tui.

Linux fork of hkay-dev/opencode-limits-sidebar — same UI, swapped data source. The reference plugin polls the macOS-only openusage menu-bar daemon; this fork polls the cross-platform usage-tui Python CLI instead, so it works on Linux without a daemon.

Prerequisites

  1. OpenCode ≥ 1.3.13 (tested on 1.14.x)
  2. usage-tui installed and authenticated:
    pipx install usage-tui
    usage-tui setup     # interactive provider setup (Claude / Codex / Copilot / OpenAI / OpenRouter)
    usage-tui doctor    # verify connectivity

Install

Via npm (after first publish)

opencode plugin @joserdf/opencode-usage-sidebar -g

From source

mkdir -p ~/.config/opencode/plugins
cd ~/.config/opencode/plugins
git clone https://github.com/joserdf/opencode-usage-sidebar.git
cd opencode-usage-sidebar
npm install
npm run build
opencode plugin "$PWD" -g

Restart OpenCode after install. The sidebar header USAGE LIMITS should appear in the right sidebar within 30 seconds.

How it works

Every 30 seconds the plugin spawns:

usage-tui show --provider all --window 5h --json

…parses the JSON, filters to [claude, codex, copilot], and renders one row per provider with:

  • Provider name + plan label (Session / Weekly / Monthly)
  • Percentage used — computed as (limit - remaining) / limit
  • Time-until-reset (in 2h, in 24d)

usage-tui reads each provider's local CLI credentials, so no extra auth lives inside OpenCode.

Failure modes

| Condition | Behavior | |---|---| | usage-tui binary missing on PATH | Banner usage-tui not installed; last-good rows persist | | Provider returns error != null | That row shows ; others keep updating | | Transient JSON / network error | Silent retry on next cycle (last-good rows preserved) |

Customizing providers

The provider allow-list is hard-coded at the top of src/shared/usage-tui.ts:

const PROVIDERS = ["claude", "codex", "copilot"] as const

usage-tui also supports openai and openrouter. To include them, add the keys to PROVIDERS, run npm run build, then opencode plugin "$PWD" -g again.

Architecture

| Layer | File | Source | |---|---|---| | SolidJS sidebar UI (ProviderLimits, LimitRow) | src/index.tsx | upstream — unchanged | | Types and rendering helpers | src/shared/limits.ts | upstream — unchanged | | Data fetch + parse + translate | src/shared/usage-tui.ts | new in this fork | | fetchUsage() body | src/index.tsx | rewritten to call the new module | | Server-side hook | src/server.ts | upstream — unchanged (no-op) |

The translator boundary in src/shared/usage-tui.ts keeps UI types insulated from usage-tui's schema, so a future schema change is a one-file fix.

Credit

  • Fork of hkay-dev/opencode-limits-sidebar — the entire UI scaffolding (SolidJS + OpenTUI, sidebar slot registration, theming) is theirs.
  • Data source: usage-tui — Python CLI that aggregates AI-service quotas.

License

MIT — see LICENSE. Original work © hkay-dev, fork © joserdf.