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

@khanhicetea/pi-multi-codex

v0.2.1

Published

Pi extension for logging into and switching between multiple OpenAI Codex accounts

Readme

pi-multi-codex

A pi extension for using multiple OpenAI Codex accounts. It creates independent provider slots while leaving pi's built-in openai-codex provider unchanged.

It reuses pi's native OpenAI Codex provider, including its OAuth, model catalog, and streaming implementation.

Requirements

  • pi 0.82.0 or newer (native provider registration)

Install

pi install npm:@khanhicetea/pi-multi-codex

For a one-off test:

pi -e ./index.ts

Usage

Three slots are registered by default:

openai-codex-1
openai-codex-2
openai-codex-3

Log into each account separately:

/login openai-codex-1
/login openai-codex-2
/login openai-codex-3

Then use pi's built-in /model command to select an account. Slot models are labeled [Codex 1] …, [Codex 2] …, and so on.

Use pi's built-in /logout command to remove a slot's credentials.

Fast mode

Run /codex-fast to toggle OpenAI's priority service tier for the current session. The footer shows fast while it is active, or fast (inactive) when fast mode is enabled but the selected model does not support it. You can also start pi with --fast.

Fast mode currently applies to these models on the built-in Codex provider and every numbered Codex slot:

  • gpt-5.4
  • gpt-5.5
  • gpt-5.6-sol
  • gpt-5.6-terra
  • gpt-5.6-luna

To enable it by default, add the same setting used by pi-codex-fast to either the global ~/.pi/agent/settings.json or project .pi/settings.json:

{
  "pi-codex-fast": {
    "enabled": true
  }
}

For model-based opt-in, set a non-empty fast_models array instead. Fast mode then turns on automatically when selecting a listed model and off when selecting another model:

{
  "pi-codex-fast": {
    "fast_models": [
      "gpt-5.4",
      "openai-codex-2/gpt-5.6-sol"
    ]
  }
}

A bare model ID matches that model across the built-in provider and every numbered slot. Use provider/model to target one provider slot. When fast_models is non-empty it takes precedence over enabled. A manual /codex-fast toggle remains in effect until the next model selection or session.

The project setting overrides the global setting. /codex-fast only changes in-memory state: it never writes settings or carries the toggle into another session. Edit the settings file to change the default across sessions.

Usage checks

Run this command to fetch rate-limit usage for the account behind the currently selected Codex provider:

/codex-usage

The result appears as a single-line compact widget, right-aligned below the editor beside the footer. It shows only the Codex slot name followed by each session or weekly window; account identifiers are omitted. Every window uses a color-highlighted remaining-quota bar with only the percentage left on the right. Model-specific limits are selected when the API exposes one for the active model.

The widget is displayed only when:

  • /codex-usage is run manually, regardless of the remaining quota
  • a background check after the agent's final settled turn finds any usage window below 20% remaining

Automatic checks are limited to once every five minutes per provider/model. Opening a session and switching models do not call the usage API and clear any previous widget. Automatic request failures stay silent; manual failures are reported. Usage credentials are resolved through pi's active provider, so each slot checks its own logged-in account.

Configuration

Set PI_CODEX_NUM_PROVIDER to create between 1 and 100 slots (default: 3):

PI_CODEX_NUM_PROVIDER=5 pi

Pi stores each slot's OAuth credentials under its provider ID. Browser and headless device-code login are supported.