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-multi-usage

v0.1.1

Published

OpenCode sidebar plugin for Codex, OpenCode Go, and CommandCode usage

Readme

opencode-multi-usage

OpenCode sidebar plugin that displays subscription usage for:

  • ChatGPT Codex
  • OpenCode Go
  • CommandCode

Providers are opt-in. If none are configured, the sidebar shows a short setup message and the plugin makes no usage requests.

Install from npm as opencode-multi-usage:

# OpenCode v1
opencode plugin opencode-multi-usage --global

# OpenCode v2
opencode2 plugin add opencode-multi-usage

Then enable providers as shown below.

OpenCode v1

[!WARNING] Support for OpenCode v1 may be dropped at any moment following the official stable release of OpenCode v2. Prefer the v2 setup for new installs.

Requires OpenCode 1.18.29 or newer. Add the package and options to ~/.config/opencode/tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [["opencode-multi-usage", { "providers": ["codex", "opencode-go", "commandcode"] }]]
}

Restart OpenCode after changing v1 TUI configuration.

OpenCode v2

Add the package and options to opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [
    {
      "package": "opencode-multi-usage",
      "options": {
        "providers": ["codex", "opencode-go", "commandcode"],
      },
    },
  ],
}

The package exports both the v2 server entrypoint and its ./tui CLI entrypoint. OpenCode loads the CLI entrypoint automatically.

Options

providers is an array containing any of "codex", "opencode-go", and "commandcode". The default is an empty array.

Set one refresh interval for every enabled provider:

{
  "providers": ["codex", "opencode-go"],
  "refreshInterval": "5m"
}

Intervals accept s, m, h, or d. Values below 10 seconds are clamped to 10 seconds. Without an override, Codex refreshes every 30 seconds and the other providers refresh every 5 minutes.

Authentication

Codex

Checked in this order:

  1. CHATGPT_ACCESS_TOKEN, with optional CHATGPT_ACCOUNT_ID.
  2. OPENCODE_AUTH_CONTENT containing OpenCode auth JSON.
  3. OpenCode's auth.json OpenAI OAuth entry.

OpenCode Go

Checked in this order:

  1. OPENCODE_GO_API_KEY.
  2. OpenCode's auth.json opencode-go entry.
  3. OpenCode's account.json opencode-go account.

CommandCode

Checked in this order:

  1. COMMANDCODE_API_KEY or COMMAND_CODE_API_KEY.
  2. OpenCode's auth.json commandcode entry.
  3. ~/.commandcode/auth.json.

COMMANDCODE_API_URL overrides the CommandCode API base URL.

Stability

The Codex integration calls the undocumented internal endpoint https://chatgpt.com/backend-api/wham/usage, which may change without notice. Reconnect the affected provider when a saved credential is rejected.

Development

npm install
npm run typecheck
npm test

Format with Prettier (printWidth: 100):

npm run format
npm run format:check

License

MIT