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

@davidaayers/opencode-codex-usage-plugin

v0.1.2

Published

OpenCode TUI plugin that shows Codex quota usage gauges and reset times.

Readme

opencode-codex-usage-plugin

An OpenCode TUI sidebar plugin that shows Codex 5-hour and weekly quota usage as compact gauges with reset countdowns.

Codex Usage
5h   ███░░░░  week █████▋░
42% · 2h      81% · 7d

This is a maintained fork of zaniluca/opencode-codex-usage-plugin. It keeps the original Codex App/CLI integration and presents the usage data in the gauge style used by the other David Ayers OpenCode plugins.

Features

  • Quota gauges — compact eighth-block gauges for the available 5-hour and weekly Codex limits
  • Proximity colors — gauge and percentage use the active theme: success <50% → accent 50–74% → warning 75–89% → error ≥90%
  • Reset countdowns — short reset times appear beneath each available window
  • Compact prompt line — identifies the most constrained window when the sidebar is hidden
  • Codex App/CLI support — reads usage through the Codex app-server protocol, sharing a WebSocket-over-Unix server across OpenCode instances
  • Live updates — refreshes every 60 seconds and on message/session events
  • Silent by design — hidden for non-Codex sessions

Install

opencode plugin --global @davidaayers/opencode-codex-usage-plugin

Or from inside OpenCode: press ctrl+p → "Install Plugin" → @davidaayers/opencode-codex-usage-plugin. Restart OpenCode and the gauges appear once the session uses an OpenAI/Codex model.

From source

OpenCode TUI plugins load from the plugin array in ~/.config/opencode/tui.json (or a project-level tui.json) — not from opencode.jsonc, whose plugin array is server-side only.

// ~/.config/opencode/tui.json
{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["file:///absolute/path/to/opencode-codex-usage-plugin/dist/tui.js"],
}

Requirements

Install either Codex App or the Codex CLI. The plugin looks for Codex in common locations and on your PATH.

If your Codex command lives somewhere else, set OPENCODE_CODEX_USAGE_COMMAND:

export OPENCODE_CODEX_USAGE_COMMAND="/path/to/codex"

How It Works

  • Usage source: the Codex app-server provides normalized 5-hour and weekly rate-limit windows.
  • Rendering: the plugin uses OpenTUI and the active OpenCode theme, with the gauge renderer kept separate from the Codex transport.
  • Lifecycle: the Effect-based service reuses or starts a shared Codex app-server over a Unix socket, connects with WebSocket, and falls back to a dedicated stdio server when the shared path is unavailable. It owns request timeouts and connection cleanup.

Development

pnpm install
pnpm check
pnpm test
pnpm build

The published plugin entrypoint is dist/tui.js, generated from src/tui.ts.

Roadmap

Cross-repository follow-up work is tracked in the OpenCode Plugins project.

Changelog

See CHANGELOG.md for release history.

Credits

The Codex integration is forked from zaniluca/opencode-codex-usage-plugin. The gauge presentation is inspired by @davidaayers/opencode-go-usage-plugin and @davidaayers/opencode-context-gauge-plugin.

License

MIT. See the upstream project for the original implementation and attribution.