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

@yuting4281/opencode-usage-plugin

v0.1.6

Published

OpenCode TUI plugin — shows AI provider usage (GitHub Copilot, Kiro, etc.) with collapsible panels and /usage screen.

Readme

@yuting4281/opencode-usage-plugin

OpenCode TUI plugin that shows your AI provider usage quota directly inside OpenCode.

Auto-detects available providers. Auto-refreshes every 60 seconds.

Supported providers

| Provider | Auth source | What it shows | |----------|-------------|---------------| | GitHub Copilot | ~/.local/share/opencode/auth.json | Premium interactions remaining %, plan type, reset date | | Kiro | ~/.config/opencode/kiro.db | Usage / limit per account | | Codex (OpenAI) | ~/.local/share/opencode/auth.json | Weekly usage %, plan type, reset countdown |

What you get

usage interface

  • Collapsible usage panel on the home screen
  • Collapsible usage panel in the session sidebar
  • /usage command for a full-screen detailed view
  • /usage-refresh command to manually refresh
  • Color-coded progress bars (green → yellow → red as quota decreases)

Requirements

  • OpenCode >= 1.3.13
  • Node.js >= 22

Setup

This is a TUI-only plugin.

  • Add it to ~/.config/opencode/tui.json
  • Do not add it to ~/.config/opencode/config.json
  • Restart OpenCode fully after changing the config

Load from npm package

If the package is available from npm, add this to ~/.config/opencode/tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "@yuting4281/opencode-usage-plugin"
  ]
}

You usually do not need to run npm install manually for the TUI plugin itself. OpenCode reads the package name from tui.json and resolves/installs it through its own plugin system.

Use the package name only. Do not use @yuting4281/opencode-usage-plugin/tui in tui.json.

When installed from npm, OpenCode resolves the package's ./tui export automatically. Users only need the package name in tui.json.

Use a local checkout

For local development or if you cloned this repo directly, point tui.json at the plugin file:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    "/absolute/path/to/opencode-usage-plugin/tui.tsx"
  ]
}

Using an absolute path is the most reliable option for local installs.

Optional helper command

The plugin works without this. Install it only if you want the opencode-auth-usage command on your PATH.

npm install -g @yuting4281/opencode-usage-plugin

Or install from GitHub:

npm install -g github:fdsf53451001/opencode-usage-plugin

The plugin automatically detects which providers are available and only shows the ones you have configured. No extra setup needed.

Prefer running connectors in a subprocess?

Most users do not need this. If you want to force the plugin to use opencode-auth-usage, configure the same plugin spec with options:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": [
    [
      "@yuting4281/opencode-usage-plugin",
      { "command": "opencode-auth-usage" }
    ]
  ]
}

If you are loading the plugin from a local checkout, replace "@yuting4281/opencode-usage-plugin" with the same absolute tui.tsx path you used above.

Options

Pass as the second element of the plugin tuple:

| Option | Default | Description | |--------|---------|-------------| | command | — | Run an external command instead of built-in connectors | | cwd | — | Working directory for the external command | | interval_ms | 60000 | Auto-refresh interval (ms) | | timeout_ms | 8000 | Command timeout (ms) | | max_items | 4 | Max rows shown in compact panels | | title | Usage | Panel title | | show_home | true | Show panel on home screen | | show_sidebar | true | Show panel in session sidebar |

Troubleshooting

  • If the panel does not appear, make sure the plugin is only configured in tui.json
  • For a local checkout, prefer an absolute path to tui.tsx
  • After changing config, fully quit and reopen OpenCode
  • Check the latest log in ~/.local/share/opencode/log/ for service=tui.plugin errors
  • If the plugin is loaded, you should see the Usage panel and the /usage command

Environment variables

| Variable | Default | Description | |----------|---------|-------------| | OPENCODE_AUTH_PATH | ~/.local/share/opencode/auth.json | Custom OpenCode auth file path | | OPENCODE_KIRO_DB_PATH | ~/.config/opencode/kiro.db | Custom Kiro database path |