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

tokpet

v0.1.2

Published

Desktop pet that surfaces your real-time AI usage / quota / balance across providers.

Readme

Tokpet

Desktop pet that surfaces your real-time AI usage / quota / balance across providers.

Companion service (Node.js) that runs on your machine, talks to each AI provider, normalizes the data, and exposes a single GET /state JSON endpoint. The Tokpet hardware (or any client) polls that endpoint to render a live status display.

Provider architecture

Providers are organized by how the vendor exposes usage data:

| Mode | Data shape | Examples | | ------------------- | ----------------------------------------------------------------- | --------------------------------------------------- | | subscription/ | Rolling-window quotas (5 h / 7 d / monthly) with reset timestamps | Claude.ai Pro / Max, Codex, OpenAI Plus, Cursor | | api-key/ | Cumulative spend / credit balance | Anthropic API, OpenAI API, Gemini API, DeepSeek API | | relay/ | Custom billing per gateway | OpenRouter, Together, KeyAI |

Each provider implements the Provider interface in src/protocol/provider.ts. Adding a new vendor only requires creating one directory under src/providers/<mode>/<id>/ and adding one import to src/providers/registry.ts.

Status

🚧 Early development. Working today:

  • ✅ Setup page + config store — pick an access mode and provider in the browser, test the connection, and the provider is activated and persisted to ~/.tokpet/config.json (restored on restart).
  • subscription/claude — reuses your local Claude Code login, calls the undocumented GET /api/oauth/usage, returns 5 h + 7 d utilization.
  • ✅ Server + aggregator + TTL cache + /state JSON contract.

api-key and relay modes are scaffolded but have no providers wired up yet.

The only public stability guarantee is the /state JSON schema — see src/protocol/state.ts.

Install

Homebrew (recommended)

brew install grpcer/tokpet/tokpet
brew services start tokpet     # first start opens the setup page automatically;
                               # runs in the background and restarts on login

npm

npm install -g tokpet
tokpet service install         # first start opens the setup page automatically;
                               # background launchd service, restarts on login

Either way, Tokpet opens a setup page where you pick how a provider exposes usage (subscription / API key / relay), choose a provider, and hit Test — on success it activates and starts appearing in GET /state. Choices are saved to ~/.tokpet/config.json and restored on the next launch.

The setup/configuration API is bound to loopback only; GET /state stays reachable on your LAN so the device (or any client) can poll it.

Manage the service:

| | Homebrew | npm | | ------ | ---------------------------- | -------------------------- | | start | brew services start tokpet | tokpet service install | | stop | brew services stop tokpet | tokpet service uninstall | | status | brew services info tokpet | tokpet service status |

Troubleshooting

Device stuck on "open the console to add a provider", or not showing up after you move it to a new network? See TROUBLESHOOTING.md.

Develop

npm install
npm run dev          # tsx watch src/index.ts
curl http://localhost:4717/state | jq

Build & run release:

npm run build
npm start

License

Apache-2.0