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

@bumpyclock/pi-codex-compat

v0.2.0

Published

Pi extension consolidating OpenAI Codex fast mode, native compaction, named OAuth accounts, live quota, historical usage, and token throughput status.

Readme

@bumpyclock/pi-codex-compat

One Pi extension that consolidates OpenAI/Codex-focused behavior:

  • /fast priority service tier (service_tier: "priority") for verified OpenAI Codex Responses requests
  • OpenAI native compaction replay for openai and openai-codex Responses APIs
  • Named OpenAI Codex OAuth accounts (/accounts)
  • Live Codex subscription quota (/usage)
  • Historical Pi/Codex CLI cost report (/usage-history)
  • Token throughput status (all providers)
  • Unified /codex manager menu

Minimum tested Pi release: 0.82.1 (@earendil-works/*).

Install

pi install npm:@bumpyclock/pi-codex-compat

Or from a local checkout:

pi install /absolute/path/to/pi-codex-compat

Important migration notes

Do not load this package together with:

  • local openai-codex-fast-mode.ts
  • local openai-compaction
  • local usage.ts / token-rate-status.ts
  • pi-accounts / pi-codex-accounts
  • pi-usage / pi-codex-usage

Duplicate extensions can refresh the same rotating credential or register conflicting commands.

Disable or remove those local/extension copies before enabling this package.

Commands

| Command | Modes | Behavior | | --- | --- | --- | | /codex | TUI menu | Accounts, Quota, Fast mode, Historical usage, Settings, Status, Help | | /codex status | TUI, RPC | Feature status | | /codex help | TUI, RPC | Help text | | /accounts | TUI | Named Codex OAuth account manager | | /usage | TUI | Live Codex subscription quota | | /usage-history | TUI, RPC | Agent-driven historical cost report | | /fast [toggle\|on\|off\|status] | TUI, RPC | Priority tier toggle | | Alt+Shift+F | TUI | Toggle fast mode |

Print and JSON modes throw a clear unsupported-mode error for these commands because Pi 0.82.1 has no observable extension-command output channel there. RPC receives a notification for TUI-only menus.

Settings

Canonical user settings:

~/.pi/agent/pi-codex-compat.json

Trusted project overrides (non-secret only):

<workspace>/.pi/pi-codex-compat.json

Private Codex account credentials:

~/.pi/agent/pi-codex-compat-accounts.json

Example:

{
  "fastMode": { "enabled": false },
  "openaiNativeCompaction": {
    "enabled": true,
    "debug": false,
    "redactSensitiveData": true,
    "supportedProviders": ["openai", "openai-codex"],
    "supportedApis": ["openai-responses", "openai-codex-responses"]
  },
  "tps": {
    "enabled": true,
    "notifyOnComplete": true
  },
  "auth": {
    "disableApiKeyWhenCodexAuthenticated": false
  }
}

Auth cost-safety policy

auth.disableApiKeyWhenCodexAuthenticated (default false) is an opt-in guard:

  • When on and a Codex OAuth login exists (default Pi openai-codex OAuth in auth.json, or a named account selected by this extension), every exact provider openai model is hidden — including built-ins and models.json additions.
  • Stale sessions still selecting openai are blocked on each turn, compaction, and summarizing tree navigation. Non-summarizing tree navigation stays allowed.
  • openai-codex and unrelated providers are unchanged. The policy never auto-switches models and never mutates OPENAI_API_KEY or credential files.
  • When auth storage cannot be read, presence is treated as unknown and the policy fails closed while enabled.
  • Toggle from /codex → Settings. Status shows Direct OpenAI API key: allowed|blocked while Codex is logged in.

Precedence

Defaults → old package-local compaction settings → legacy global settings.json → canonical user settings → legacy project settings.json → canonical project settings → PI_OPENAI_NATIVE_COMPACTION_* environment overrides.

Canonical values win over legacy values at the same scope. Environment overrides win over all files. Validated recognized values are migrated into canonical files; legacy sources are retained for rollback.

Legacy sources consulted when canonical values are absent:

  • ~/.pi/agent/settings.jsonextensionSettings.openaiCodexFastMode
  • ~/.pi/agent/extensions/openai-compaction/settings.json
  • openaiNativeCompaction in global/project settings.json
  • PI_OPENAI_NATIVE_COMPACTION_*
  • pi-accounts.json → only the openai-codex provider section
  • pi-codex-accounts.json / codex-accounts.json

Security and failure behavior

  • Account activation failures fail closed for openai-codex (no silent fallback credential).
  • When auth.disableApiKeyWhenCodexAuthenticated is enabled, unknown/corrupt Codex auth storage fails closed for direct openai API-key use (hide/block with a redacted error).
  • The auth.json presence reader is extension-owned and read-only: it never creates or writes auth.json, and never logs token fields.
  • Compaction failures fail open to Pi's normal compaction.
  • Quota requests send credentials only to the official ChatGPT origin (https://chatgpt.com) and use bounded response reads.
  • Debug artifacts redact authorization headers, API keys, JWT-like values, and exact credential strings.
  • Credential files use private directory permissions and mode 0600 on POSIX.
  • Pi extensions run with full user permissions. Only install packages you trust. See Pi's unsandboxed extension trust model.

Development

npm install
npm run format
npm run check
npm run pack:dry
npm run smoke:pi

Releases

Merges to main update a Release Please pull request. Merging that release pull request creates a GitHub release and publishes the matching package version through .github/workflows/release.yml.

The workflow uses npm trusted publishing with GitHub Actions OIDC and provenance; it does not require a long-lived npm token. Manual runs default to a dry run. Choose release only when package.json contains the version to release.

License

MIT. See LICENSE and NOTICES.md for adapted upstream attribution (Jordy Van Domselaar; narumiruna).