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

spendguardco

v0.4.0

Published

SpendGuard CLI: route your AI API keys through SpendGuard in one command

Readme

spendguardco

Route your AI API calls through SpendGuard in one command. No code changes: the CLI only edits your .env.

Use Claude Code? claude

npx spendguardco claude
  1. Reads your local Claude Code history and shows what the last 30 days cost: tokens at API list price per model, and every paid service you used via MCP (fal, Higgsfield, ElevenLabs, ...). Nothing is uploaded at this point.
  2. Asks for your email, sends a sign-in link, and continues by itself when you click it. No token to paste. New email = new workspace; --join K7F2 joins a colleague's.
  3. Installs a PostToolUse hook (every tool call Claude makes is reported, priced) and a spendguard MCP server so you can ask Claude "what did I spend on AI this week".

Only counts leave your machine: tool names, model names, token counts, number of images / seconds / characters. Never prompts or content.

Related: npx spendguardco sync pushes token usage from local transcripts; hook and mcp are what the installer wires up.

Team members: configure

Your admin gives you personal sg_ keys (one per provider). In your project:

npx spendguardco configure --openai sg_... --anthropic sg_... --google sg_...

This rewrites your .env:

  • Comments out the original real API keys (kept as backup)
  • Inserts your sg_ proxy keys in the variables the official SDKs read (OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, ...)
  • Adds the matching base URL variables (OPENAI_BASE_URL, ANTHROPIC_BASE_URL, GOOGLE_GEMINI_BASE_URL, ...) pointing at SpendGuard

Run it without flags and it asks for each key. Run it again later with new keys and it just updates, no duplicate lines.

Existing workspace: connect

cd your-project
npx spendguardco connect

Scans .env for real API keys, signs you in with a magic link (you paste the link from your email), registers each provider in your workspace, issues sg_ proxy keys and rewrites your .env. This is the "Developer? Run one command" route in onboarding step 3.

New workspace: init

cd your-project
npx spendguardco init
  1. Scans .env for real API keys (OpenAI, Anthropic, Google, fal, ElevenLabs, and more)
  2. Creates your SpendGuard workspace and emails you a sign-in link
  3. You paste the link back into the terminal
  4. Registers each provider (your real key is stored encrypted, never shown to your team)
  5. Issues sg_ proxy keys and rewrites your .env to use them

Flags

--backend URL       SpendGuard backend (default: https://app.spendguard.co)
--env FILE          init/connect: use this .env instead of searching the folder
--email, --org      init/connect: skip the prompts
--openai sg_...     configure: proxy key per provider
--anthropic sg_...  (also: google, fal, elevenlabs, heygen, runway, replicate,
--google sg_...      stability, higgsfield, adobe-firefly, mistral, groq,
...                  deepseek, xai, perplexity, together, openrouter)

Guarantees

  • Never sends your real API keys anywhere except, during init, to your own SpendGuard workspace over HTTPS.
  • Never modifies code, only the first .env it finds (.env, .env.local, .env.production, .env.development, then src/, config/, backend/).
  • Refuses to write a key that does not start with sg_.

Notes

  • Python: load_dotenv(override=True) if your shell already exports API keys.
  • Google: the google-genai SDK reads GOOGLE_GEMINI_BASE_URL and GEMINI_API_KEY; both are written.
  • Set SPENDGUARD_URL to point every command at a self-hosted backend.