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

@arhen/pi-add-commandcode

v0.0.3

Published

pi extension: Command Code Provider API (models, ZDR).

Readme

@arhen/pi-add-commandcode

npm version license

Install

Requires the pi coding agent — install it first: npm install -g @earendil-works/pi-coding-agent.

pi install npm:@arhen/pi-add-commandcode

Command Code Provider API for pi — 58 models on one key, live catalog, dual-endpoint routing, Zero Data Retention toggle.

  • Login: /login → "Command Code" → API key (or COMMANDCODE_API_KEY)
  • /commandcode — status: key, model count, ZDR state
  • /commandcode zdr [on|off] — Zero Data Retention (persisted across sessions)

Endpoint routing

The API is two endpoints on one base, and using the wrong one is a hard 400:

| Models | Endpoint | pi API | | --- | --- | --- | | claude-* (7) | /provider/v1/messages | anthropic-messages | | everything else (51) | /provider/v1/chat/completions | openai-completions |

Routing is per model, so /model just works — pick any id and the right shape is sent.

Models are fetched in the extension factory, which pi awaits before startup finishes, so the catalog is ready for interactive startup and /model. Fetching in session_start instead leaves the provider empty on first paint.

Model metadata

GET /provider/v1/models returns only id, name, and context_length — no pricing, no capability flags. So metadata comes from two sources:

  • Claude ids reuse pi's built-in ANTHROPIC_MODELS entry. Rates are identical to the Command Code docs, and it carries forceAdaptiveThinking and supportsTemperature, which Opus 4.7+/Sonnet 4.6 need to think correctly.
  • Everything else reads the CATALOG table in src/index.ts, transcribed from pricing & limits.
npx tsx src/index.test.ts   # runs the real factory against a stub API

The test asserts every live model resolves to exactly one source, that Claude ids route to Messages with a /v1-less baseUrl, and that an offline refresh preserves the catalog rather than emptying it. Run it after Command Code adds models: a model in neither source still registers, but bills as free and claims reasoning: true, so the test fails rather than letting that ship.

Zero Data Retention

/commandcode zdr on sends x-cmd-zdr: 1 on every request, so it routes only through ZDR-capable upstreams. Per the docs there is no silent fallback: a model with no ZDR upstream fails with 422 cmd_zdr_no_providers instead of quietly using a non-ZDR route. ZDR may also change which upstream serves you, so cost can differ.

Notes

  • Reasoning effort accepts low|medium|high|xhigh|max. There is no none, so thinking-off is marked unsupported and pi omits the field.
  • Token usage arrives at the end of every stream with no opt-in, so pi's built-in cost footer works as-is.
  • Claude ids register on any plan but return 403 MODEL_NOT_IN_PLAN unless your plan covers them.
  • Long-context pricing tiers (8 models bill ~2× past a threshold) are not modelled — CATALOG holds the standard tier, so cost reads low on very large contexts.

License

MIT.