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

v0.3.2

Published

An OpenCode plugin that surfaces local usage statistics and reserves a cloud usage API integration.

Readme

OpenCodeUsage

An OpenCode plugin that surfaces local usage statistics (sessions, messages, tokens, cost, model/tool breakdown) and reserves a hook for cloud plan/remaining-quota information once OpenCode exposes a public API for it.

Install

Add the plugin to your OpenCode config (opencode.json or ~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-usage-stats"]
}

OpenCode will install the npm package automatically on startup.

Use

The plugin provides both a TUI sidebar panel and a slash command.

TUI sidebar

When OpenCode starts, a small Usage panel appears in the right sidebar showing the current session's live stats:

  • Messages
  • Cost
  • Tokens
  • Top model

It updates automatically as new assistant messages arrive.

Slash command

Run the slash command in any session:

/usage

Or ask the agent:

Show my OpenCode usage

This returns a markdown summary of all sessions, messages, tokens, cost, model/tool breakdown.

Configuration

{
  "plugin": ["opencode-usage-stats"],
  "opencode-usage-stats": {
    "enableCloudApi": false,
    "cloudApiUrl": "https://console.opencode.ai/api/usage",
    "apiKey": ""
  }
}
  • enableCloudApi: When true, the plugin attempts to fetch cloud plan/usage data. Currently this is a placeholder because OpenCode does not expose a public usage API.
  • cloudApiUrl: Reserved URL for the future cloud usage endpoint.
  • apiKey: Reserved API key for the future cloud usage endpoint.

Data sources

  • C-1 (enabled by default): Aggregates local usage by reading the running OpenCode session list via the OpenCode SDK (client.session.list() / client.session.messages()).
  • C-2 (placeholder): Will call the configured cloud usage API when OpenCode releases a public endpoint. Until then, it is disabled and the plugin reports the limitation.

Repository

https://github.com/QianYuan1437/OpenUsage

License

MIT