Unofficial CLI for checking Codex Desktop reset-credit expirations from your terminal.
It reads the local Codex Desktop auth file at runtime, calls the same ChatGPT backend endpoint that the desktop app uses, and prints the available reset credits for the currently logged-in account.
- No token is stored in this repo or copied into the CLI.
- The CLI reads
~/.codex/auth.jsononly on the machine where you run it. - The Codex bearer token is sent only to allowlisted HTTPS OpenAI hosts:
chatgpt.comorchat.openai.com. - Account IDs, credit IDs, local auth paths, and source profile IDs are redacted by default. Pass
--show-identifiersonly when you intentionally need them. - The raw request command is read-only and accepts only relative API paths.
This is an unofficial tool that relies on an internal/undocumented Codex Desktop endpoint. It may break if OpenAI changes the app or backend API.
Run it directly with npx:
npx --yes codex-resets credits summaryOther common commands:
npx --yes codex-resets doctor
npx --yes codex-resets credits list
npx --yes codex-resets --json credits summaryIf the npm package is still propagating, you can run the GitHub version directly:
npx --yes github:sourav-bhar/codex-resets credits summaryTo install it globally:
npm install -g codex-resets
codex-resets credits summaryTo install from a local checkout:
git clone https://github.com/sourav-bhar/codex-resets.git
cd codex-resets
make install-localThe local checkout installer copies codex-resets to ~/.local/bin. Make sure ~/.local/bin is on your PATH.
codex-resets doctor
codex-resets credits list
codex-resets credits summary
codex-resets --json credits summaryTo intentionally include local/account identifiers:
codex-resets --show-identifiers --json credits listTo use a non-default Codex auth file for one run:
codex-resets --auth-file ~/path/to/auth.json credits listWith --json, successful commands emit stable JSON to stdout. Errors also emit JSON and never include bearer tokens or cookies:
{
"ok": false,
"error": {
"message": "Codex auth file not found",
"code": "AUTH_FILE_MISSING"
}
}Generate a LaunchAgent plist:
mkdir -p ~/Library/LaunchAgents ~/.codex/resets
CODEX_RESETS_EXECUTABLE="$(command -v codex-resets)" codex-resets schedule launchd-plist --interval-minutes 360 > ~/Library/LaunchAgents/com.codex-resets.check.plist
launchctl bootstrap "gui/$(id -u)" ~/Library/LaunchAgents/com.codex-resets.check.plistThe generated job writes JSON summaries to ~/.codex/resets/codex-resets.log and errors to ~/.codex/resets/codex-resets.err.
codex-resets request get /wham/rate-limit-reset-creditsOnly GET is supported. The CLI deliberately does not include a command to consume or redeem a reset credit.
Do not paste raw request output into public issues or social posts. Raw endpoint responses can contain account-specific fields that are not part of the redacted high-level commands.
make test
npm run checkThe project has no runtime npm dependencies.