@baggiiiie/pi-codex-usage

A pi package that adds the `/codex-usage` command and status widget.

Package details

extension

Install @baggiiiie/pi-codex-usage from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@baggiiiie/pi-codex-usage
Package
@baggiiiie/pi-codex-usage
Version
0.0.3
Published
May 4, 2026
Downloads
236/mo · 14/wk
Author
baggiiiie
License
unknown
Types
extension
Size
25.8 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@baggiiiie/pi-codex-usage

A pi package that adds the /codex-usage command and status widget.

Install

pi install /path/to/pi-stuff/packages/codex-usage

Or after publishing:

pi install npm:@baggiiiie/pi-codex-usage

Usage

/codex-usage
/codex-usage refresh
/codex-usage clear
/codex-usage help

Notes

Run /login in pi and choose ChatGPT Plus/Pro (Codex) before using the default endpoint.

The package refreshes in the background every 5 minutes by default instead of on every turn_end.

Multiple pi sessions now share a small temp-file cache per provider/url, so they usually reuse the same recent usage snapshot instead of all fetching separately.

Optional environment overrides:

CODEX_USAGE_REFRESH_INTERVAL_MS=300000   # 5 min default
CODEX_USAGE_REFRESH_INTERVAL_MS=0        # disable background refresh
CODEX_USAGE_CACHE_TTL_MS=300000          # shared cache TTL
CODEX_USAGE_CACHE_TTL_MS=0               # disable shared cache reuse