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

@kungfusaini/opencode-codex-limits

v0.2.1

Published

OpenCode TUI plugin for viewing Codex usage limits in the sidebar and command palette.

Readme

opencode-codex-limits

Tiny OpenCode TUI plugin for checking OpenAI Codex / ChatGPT subscription usage limits without involving the agent or adding anything to conversation context.

It adds a sidebar panel and keeps a floating command-palette dialog with the useful Codex windows:

5h limit
[█████████████░░░░░░░]
66% left · 34% used
resets in 2h 20m
Sun, Jun 07, 07:34 PM

Weekly limit
[███████████████████░]
93% left · 7% used
resets in 6d 5h
Sat, Jun 13, 10:53 PM

GPT-5.3-Codex-Spark
5h limit
[████████████████████]
98% left · 2% used
resets in 2h 27m
Sun, Jun 07, 07:41 PM

Features

  • Sidebar panel, refreshed every two minutes.
  • Floating TUI dialog, no agent turn required.
  • Does not add usage output to chat context.
  • Shows the main 5-hour and weekly Codex limits.
  • Shows additional usage buckets returned by the API, including GPT-5.3-Codex-Spark when available.
  • Shows remaining credits when the API reports a balance.
  • Includes progress bars, percent left/used, relative reset time, and exact reset date/time.
  • Uses your existing OpenCode OpenAI OAuth credential.
  • No Codex routing plugin and no OpenCode source changes.

Requirements

  • OpenCode with TUI plugin support.
  • Node.js 20+.
  • An existing OpenAI OAuth login in OpenCode:
opencode auth login

The plugin reads OpenCode's local OAuth file at:

~/.local/share/opencode/auth.json

It never prints access or refresh tokens.

Install

The proper OpenCode TUI plugin install is to add the npm package to your tui.json plugin list. OpenCode installs npm plugins automatically at startup.

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "@kungfusaini/opencode-codex-limits"
  ]
}

Then restart OpenCode.

Note: the unscoped npm name opencode-codex-limits is already taken, so this package uses the @kungfusaini scope.

For local development from a checkout:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "file:///absolute/path/to/opencode-codex-limits/src/index.js"
  ]
}

Restart OpenCode after changing tui.json.

Usage

The sidebar panel appears automatically after OpenCode starts.

To open the detailed popup, open the command palette and choose:

Codex limits

If your OpenCode build routes TUI slash commands, /limits and /codex-limits may also open the dialog.

CLI

The package also includes a small CLI for debugging:

opencode-codex-limits
opencode-codex-limits --json

How it works

The plugin reuses OpenCode's OpenAI OAuth credential and calls the same ChatGPT backend usage endpoint used by Codex-style clients:

GET https://chatgpt.com/backend-api/wham/usage

It extracts the primary 5-hour window and secondary weekly window from the response, plus any additional usage buckets exposed in additional_rate_limits.

Security notes

  • Tokens are read locally from OpenCode's auth file.
  • Tokens are not printed.
  • Error messages are redacted before display.
  • The plugin may refresh the local OAuth token if it is expired, matching normal OAuth behavior.

License

MIT