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-sub-aliases

v0.2.2

Published

Pi extension that adds named subscription-account aliases for the built-in Anthropic and OpenAI Codex OAuth providers.

Readme

pi-sub-aliases

npm CI Pi extension License: MIT

Use multiple Claude and ChatGPT subscriptions in Pi without logging in and out of the built-in anthropic and openai-codex providers.

Pi has one OAuth slot per provider id. This extension creates named provider aliases. Each alias reuses Pi's built-in OAuth flow and live model catalog, but stores credentials separately.

Example result:

anthropic-work/claude-opus-4-8
anthropic-personal/claude-sonnet-4-6
openai-codex-work/gpt-5.5

The active alias is also exposed to extension status integrations such as pi-powerline-footer under the status key sub-aliases:

claude-work · opus-4.8
codex-work · gpt-5.5

Requirements

Pi 0.82.1 or newer. Nothing else — aliases reuse Pi's own built-in OAuth flows and model catalog on a stock install.

Install

pi install npm:pi-sub-aliases

For local development:

pi install /absolute/path/to/pi-sub-aliases

Config

Create ~/.pi/agent/sub-aliases.json:

{
  "aliases": [
    { "slug": "work", "label": "Work", "handle": "claude-work" },
    { "slug": "personal", "label": "Personal", "handle": "claude-me" },
    { "provider": "openai-codex", "slug": "work", "label": "Codex Work" }
  ]
}

Optional project override (merged over global config in trusted projects):

.pi/sub-aliases.json

Rules:

  • provider is "anthropic" (default) or "openai-codex"
  • slug creates the provider id: anthropic-<slug> or openai-codex-<slug>
  • label is shown during OAuth login (defaults to the title-cased slug)
  • handle is used by integrations such as pi-fusion; defaults to claude-<slug> or codex-<slug> per provider
  • later entries with the same (provider, slug) replace earlier ones (this is how project config overrides global); the same slug may be reused across providers
  • handles must be unique across global and project config files

Model metadata (context window, max tokens, cost) is always cloned from Pi's live model registry at startup — never hardcoded, no config overrides.

Use

Login once per alias:

/login anthropic-work
/login openai-codex-work

Select models normally:

/model anthropic-work/claude-opus-4-8
/model openai-codex-work/gpt-5.5

pi-fusion can use handles as shorthand:

{ "model": "claude-work/opus-4.8" }

For openai-codex aliases the extension also keeps the Codex environment (OPENAI_CODEX_*, CHATGPT_ACCOUNT_ID) in sync with the selected alias account, so pi-sub-bar tracks the active subscription.

Migration

From pi-claude-alias

  • Package renamed: replace npm:pi-claude-alias with npm:pi-sub-aliases in ~/.pi/agent/settings.json.
  • Config file renamed: move ~/.pi/agent/claude-alias.json to ~/.pi/agent/sub-aliases.json (same schema; provider is optional and defaults to anthropic). There is no legacy fallback.
  • Footer status key renamed: claude-aliassub-aliases.
  • Provider ids are unchanged (anthropic-<slug>), so stored OAuth credentials and model-router.json patterns keep working — no re-login needed.

From @carlosgtrz/pi-codex-aliases

  • Replace npm:@carlosgtrz/pi-codex-aliases with npm:pi-sub-aliases and declare your Codex accounts in sub-aliases.json with "provider": "openai-codex".
  • Provider ids are unchanged (openai-codex-<slug>), so stored OAuth credentials keep working — no re-login needed.
  • Model metadata is cloned live from Pi's registry, so alias models no longer drift from the built-in catalog.

Non-goals

No proxy. No router. No failover. No quota logic. Just separate OAuth slots with useful names.

Attribution

The Codex stream wrapper (src/codex-stream.ts) and Codex env sync (src/codex-env.ts) are derived from CarlosGtrz/carlosgtrz-pi-extensions (MIT).