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

@zle13/pi-codex-auth

v0.2.3

Published

OpenAI Codex multi-account switcher and quota monitor extension for Pi Coding Agent

Readme

@zle13/pi-codex-auth

An OpenAI Codex multi-account switcher and quota monitor extension for Pi Coding Agent (@earendil-works/pi-coding-agent).

Directly connects Pi with your codex-auth accounts, providing seamless account switching, quota tracking, live file watching, and bi-directional token synchronization.


Prerequisites & Dependencies

Required CLI Dependency:
This extension relies on codex-auth (@loongphy/codex-auth) to manage OpenAI OAuth account credentials, aliases, and snapshots under ~/.codex/accounts/.

Install codex-auth globally via npm:

npm install -g @loongphy/codex-auth

Authenticate your OpenAI Codex accounts using codex-auth:

# Login and register your accounts
codex-auth login

# (Optional) Set friendly aliases
codex-auth alias set <query> work
codex-auth alias set <query> personal

Installation in Pi

Install this package into Pi:

pi install npm:@zle13/pi-codex-auth

Or install from a local clone:

pi install /path/to/zle-pi/packages/codex-auth

Features

  • Interactive Switcher: Run /codex-auth in interactive mode to pick and switch between accounts using a clean TUI selector.
  • codex-auth v0.3.0 & Schema 4 Ready: Full support for codex-auth v0.3.0, schema_version: 4, product-level plan naming (business, enterprise), and new JSON API contracts.
  • Previous Account Shortcut (-): Jump back and forth between previous accounts with /codex-auth - or /codex-auth switch -.
  • Flexible Selectors: Switch by friendly alias, email substring, display row number (e.g. /codex-auth 1), or account name.
  • Quota & Credits Monitoring: Displays 5h and weekly quota percentages, reset countdowns, credit balances, and reset credits in status views and picker dialogs. It fetches the active account's live quota at session start and after Pi Codex responses no more than once per 90 seconds; use /codex-auth refresh for an immediate update.
  • Full Autocomplete: Rich tab-completion for /codex-auth subcommands (switch, list, alias, sync, refresh, widget, footer), previous shortcut (-), and registered accounts.
  • Alias Management: Set or clear aliases directly from Pi via /codex-auth alias set <query> <alias> and /codex-auth alias clear <query>.
  • Pi Footer Status Badge: Displays a compact status badge (e.g. codex #work · 5h 95% · 7d 99% or codex #1 · 5h 95% · 7d 99%) directly in Pi's footer.
  • Dedicated Quota Widget: Renders a subtle 2nd-line bar below the editor showing remaining 5-hour and weekly rate limits (100% when unused, 0% when depleted, consistent with codex-auth) with faint hairline separation.
  • Live File Watcher: Automatically detects external codex-auth registry and active-account changes from other terminals and updates Pi immediately.
  • Safe Bi-directional Token Sync: When Pi refreshes an expired OAuth token, the new tokens are written back to the account's managed snapshot and active auth without cross-account contamination.
  • Strict Secret Redaction: All tokens, refresh tokens, and private account IDs are completely protected and masked in logs/UI.
  • Persistent Display Preferences: Toggle settings (/codex-auth widget on|off and /codex-auth footer on|off) are automatically saved to ~/.pi/agent/codex-auth.json and persist across sessions.

Command Reference

| Command | Description | | :--- | :--- | | /codex-auth | Open the interactive TUI account picker dialog | | /codex-auth - | Jump directly back to the previously active account | | /codex-auth switch <query> | Switch directly by alias, email fragment, row number (1), account name, or - | | /codex-auth <query> | Shortcut to switch directly to an account or previous (-) | | /codex-auth list / /codex-auth status | Show all registered accounts, 5h & weekly quotas, and credit balances | | /codex-auth alias set <query> <alias> | Set an alias for the matched account | | /codex-auth alias clear <query> | Clear an alias for the matched account | | /codex-auth sync | Manually force a bi-directional sync between ~/.codex and Pi | | /codex-auth refresh | Fetch the active account's current quota immediately | | /codex-auth widget on\|off | Toggle the quota progress line below the editor | | /codex-auth footer on\|off | Toggle the footer status badge |


License

MIT