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-copilot-budget

v1.2.0

Published

GitHub Copilot premium budget in the OpenCode TUI sidebar

Downloads

540

Readme

opencode-copilot-budget

Shows your GitHub Copilot premium request budget in the OpenCode TUI sidebar. Only visible when the active provider is github-copilot.

Preview

Features

  • Progress bar that turns red when you reach 90 % of your budget
  • Request count and percentage used
  • ↻ Refresh button in the header row, with pointer cursor on hover
  • Reset date, updated automatically after prompt submit and after every AI response
  • 5-minute cache to avoid unnecessary API calls
  • Works with paid and free Copilot plans

Requirements

  • OpenCode with github-copilot as your active provider
  • A GitHub token via one of:
    • GITHUB_TOKEN or GH_TOKEN environment variable
    • GitHub CLI (gh auth login)

Install

Option A — OpenCode plugin manager

opencode plugin opencode-copilot-budget

This installs the plugin and adds it to your ~/.config/opencode/tui.json automatically.

Option B — manual

Add to ~/.config/opencode/tui.json (create the file if it doesn't exist):

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-copilot-budget"]
}

Option C — local path (no npm)

Point OpenCode directly at the source file by absolute path:

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

Token setup

The plugin discovers your GitHub token in this order:

  1. GITHUB_TOKEN environment variable
  2. GH_TOKEN environment variable
  3. Output of gh auth token (GitHub CLI)

If none of the above are available, add the token to your shell profile:

# ~/.zshrc or ~/.bashrc
export GITHUB_TOKEN="ghp_your_token_here"

To pull it from the GitHub CLI:

export GITHUB_TOKEN=$(gh auth token)

What it shows

| Situation | Display | |---|---| | Capped plan | progress bar + 117 / 1000 Premium Requests | | ≥ 90 % used | progress bar turns red | | Unlimited plan | 62 used (unlimited) | | Overage consumed | +5 overage (shown below usage) | | Reset date known | Resets on 1 May (date in bold) | | Manual refresh | inline 🔄 Refresh next to the first usage line | | Token missing / network error | sync unavailable | | First load | syncing... |

Uninstall

Remove opencode-copilot-budget from the plugin array in ~/.config/opencode/tui.json.


Contributing

All logic lives in a single file — src/index.tsx — so it's easy to get started.

Local development setup

  1. Clone the repo:

    git clone https://github.com/bhaskarmelkani/opencode-copilot-budget
    cd opencode-copilot-budget
    npm install
  2. Point OpenCode at your local clone via an absolute path in ~/.config/opencode/tui.json:

    {
      "$schema": "https://opencode.ai/tui.json",
      "plugin": ["/absolute/path/to/opencode-copilot-budget"]
    }
  3. Edit src/index.tsx and restart OpenCode to see changes.

Codebase overview

src/index.tsx   — entire plugin: token discovery, API fetch, caching, and UI

| Area | Function / component | |---|---| | Token discovery | discoverToken() | | API response parsing (paid + free tiers) | parseResponse() | | Fetch with 5-minute cache | fetchCopilotUsage() | | Progress bar | ProgressBar | | Usage display (SolidJS) | UsageDetail, View | | Plugin registration | bottom of file |

Submitting changes

  • Open an issue first for non-trivial changes so we can align on direction
  • Keep PRs focused — one concern per PR
  • If you add a new display state, update the "What it shows" table above

License

MIT — see LICENSE.