codexc
v0.1.0
Published
A CLI utility that keeps the Codex CLI authenticated.
Downloads
15
Readme
codexc
codexc is a small helper CLI that keeps the Codex CLI authenticated. It detects whether Codex is logged in, refreshes expiring tokens, or walks you through the OAuth login flow when needed.
Usage
npx codexcRunning the command performs the following steps:
- Checks
~/.codex/auth.jsonto see whether a refresh token exists. - If logged in, decodes the current access token to determine whether it will expire within the next two hours. If so,
codexcrefreshes the tokens via the OpenAI OAuth API. - When not logged in (or refreshing fails), launches the Codex OAuth flow by opening your browser, hosting the local callback server, exchanging the authorization code for tokens, and persisting them to
~/.codex/auth.json.
The resulting file matches the format written by codex login, including the tokens block and last_refresh timestamp.
Set DEBUG=1 to see stack traces if anything goes wrong.
