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

pi-proxy-models

v0.0.4

Published

Pi coding-agent extension that exposes CLIProxyAPIPlus models (Claude, Gemini, OpenAI/Codex, Copilot, Kiro, GLM, Qwen, ...) to pi's model picker, routing each family through its native streaming API (anthropic-messages, openai-completions, google-generati

Readme

pi-proxy-models

A pi-coding-agent extension that exposes CLIProxyAPIPlus models to pi's model picker and routes each model family through its native streaming API (Anthropic Messages, OpenAI Chat Completions, or Google Generative AI).

That means you can /login to Claude Code, Gemini CLI, OpenAI Codex, GitHub Copilot, Kiro, GLM, etc. inside CLIProxyAPIPlus once, and then consume all of those subscriptions from pi with their native features intact — prompt caching for Claude, thinking for Gemini, and so on.

Why three providers?

pi.registerProvider() forces a single baseUrl per provider, but the Anthropic, OpenAI, and Google SDKs expect different base paths (/, /v1, /v1beta). The extension therefore partitions the discovered models across up to three providers:

| Provider | Family | pi API | base path | | ----------------- | ------------------ | ------------------- | ------------------ | | cliproxy | Claude / Anthropic | anthropic-messages | <url> | | cliproxy-openai | OpenAI / Codex / Copilot / Kiro / GLM / Qwen … | openai-completions | <url>/v1 | | cliproxy-gemini | Google / Gemini | google-generative-ai| <url>/v1beta |

Providers with no matching models are not registered. If you only run Claude accounts through CLIProxy, you only get cliproxy/… models.

Install

Requires a running CLIProxyAPIPlus instance. See the upstream README for Docker/docker-compose setup.

Drop the single file into pi's global extension directory:

# from this repo
mkdir -p ~/.pi/agent/extensions/cliproxy
ln -sf "$(pwd)/index.ts" ~/.pi/agent/extensions/cliproxy/index.ts

or copy instead of symlinking if you prefer:

mkdir -p ~/.pi/agent/extensions/cliproxy
cp index.ts ~/.pi/agent/extensions/cliproxy/index.ts

For quick one-shot testing without installing:

pi -e ./index.ts

Configure

The extension reads its config in this order (first match wins):

  1. Environment variables CLIPROXY_URL and CLIPROXY_API_KEY
  2. ~/.pi/agent/cliproxy.json:
    {
      "baseUrl": "http://localhost:8317",
      "apiKey": "your-api-key"
    }
  3. Default: baseUrl = http://localhost:8317, no API key

A missing/empty API key is tolerated — the extension passes a placeholder downstream. CLIProxyAPIPlus accepts any value when its own api-keys: list is empty. When api-keys: is populated, set CLIPROXY_API_KEY to one of those values.

Examples:

# Env-based (remote proxy with auth)
export CLIPROXY_URL=https://my-proxy.example.com
export CLIPROXY_API_KEY=abc123
pi

# File-based (persistent local config)
cat > ~/.pi/agent/cliproxy.json <<EOF
{ "baseUrl": "http://localhost:8317", "apiKey": "dev-key" }
EOF
pi

Usage

Start pi and pick a model with Ctrl+P or /model:

cliproxy/claude-sonnet-4-5
cliproxy/claude-opus-4-5
cliproxy-gemini/gemini-2.5-pro
cliproxy-openai/gpt-5-codex
...

Or via flag:

pi --provider cliproxy --model claude-sonnet-4-5
pi --provider cliproxy-gemini --model gemini-2.5-pro
pi --provider cliproxy-openai --model gpt-4o

Slash commands

| Command | Description | | ------------------- | -------------------------------------------------------- | | /cliproxy-status | Ping the proxy, show model count + auth info | | /cliproxy-models | List all discovered models grouped by owned_by | | /cliproxy-refresh | Re-fetch the model list and re-register all providers |

Listing models from the CLI

pi --list-models cliproxy         # Claude-family models
pi --list-models cliproxy-gemini  # Gemini-family models
pi --list-models cliproxy-openai  # everything else

Behaviour notes

  • Model metadata (contextWindow, maxTokens, reasoning, image input) is inferred from the model ID; costs are set to 0 because upstream accounts are paid via subscription, not tokens.
  • Startup resilience — if the proxy is unreachable at launch, the extension still loads with a small static fallback list and warns the user. Run /cliproxy-refresh once the proxy is back online.
  • No Bearer header is added by pi — each native SDK sends its own auth (Anthropic x-api-key, OpenAI Authorization: Bearer, Google x-goog-api-key) using the configured key.

Troubleshooting

CLIProxy unreachable — verify the proxy is listening:

curl -s http://localhost:8317/v1/models | jq '.data | length'

302 Found / unauthorized from Gemini or OpenAI — CLIProxyAPIPlus is forwarding to the upstream API with an unauthenticated token. Check that you have an account linked for that provider in your proxy's auths/ directory, or set a valid key that matches the proxy's api-keys: list.

Models don't appear after starting CLIProxy — run /cliproxy-refresh in a running pi session, or restart pi.

License

MIT