AI how-to notes · 2026-09-17 · last run 2026-09-17 · 한국어 원문
Checking Codex CLI login status — codex login status, and where usage lives (/status, /usage)
One line summary
codex login status tells you in one line whether you're logged in. On our PC it printed Logged in using ChatGPT. Usage is documented as something you view with /status and /usage inside the chat screen, and the help text we checked had no usage command at all.
In this PC's ~/.codex we confirmed a file named auth.json. We did not check its contents or where authentication is actually stored.
Who this is for
- Anyone who wants to know whether codex is logged in, and by which method
- Anyone who wants to see the current state before logging in again
- Anyone hunting for where the remaining usage is shown
Test environment
| Item | Value |
|---|---|
| OS | Windows 11 Home (10.0.26200) |
| Shell | Git Bash |
| codex | codex-cli 0.153.4 |
CODEX_HOME environment variable | unset or empty (printed as CODEX_HOME=unset) |
| Login method | ChatGPT account (per the output below) |
We never ran codex login or codex logout while writing this note.
1. Finding the status command in the help text
The command list in codex --help has two login-related lines.
login Manage login
logout Remove stored authentication credentialsThe subcommand list in codex login --help has status and help.
Usage: codex login [OPTIONS] [COMMAND]
Commands:
status Show login status
help Print this message or the help of the given subcommand(s)The same help text shows --with-api-key, --with-access-token and --device-auth as login method options. codex login is the command that manages login, so when you only want the state, typing status explicitly is the safe habit (we did not run it with no options this round).
2. Running codex login status
codex login statusLogged in using ChatGPTThe exit code was 0. The account email was not printed. Our records show standard output was empty and this line went to standard error, so a script that captures standard output only — codex login status > status.txt — will miss the message (we did not run that exact form). Add 2>&1, or judge by the exit code.
We also looked at what a codex that isn't logged in prints. This is the same command on codex 0.154.0, installed temporarily in WSL Ubuntu. The install and version check are written up in Installing Codex CLI in WSL (Ubuntu).
Not logged inThe exit code here was 1. In this round we got 0 in the logged-in Windows environment and 1 in the not-logged-in WSL environment. We did not check exit codes for other failure cases such as network errors.
3. The wider view from codex doctor
codex --help also lists doctor Diagnose local Codex installation, config, auth, and runtime health. We ran it with the summary option.
codex doctor --summary --no-color --asciiThe auth-related lines came out like this (excerpt from the full output).
Configuration
[ok] config loaded
[ok] auth auth is configured
[ok] mcp 1 server (1 stdio) · 0 disabled
...
Connectivity
[ok] network no proxy env vars
[ok] websocket connected (HTTP 101 Switching Protocols) · 15s timeout
[ok] reachability active provider endpoints are reachable over HTTP
...
22 ok | 1 idle | 3 notes | 1 warn | 0 fail degradedauth is configured only tells you credentials exist. codex login status was clearer about the login method. doctor also has a --json option (Emit a redacted machine-readable report), which we did not use here.
4. Where the credentials file lives
The help text gives the config file location as ~/.codex/config.toml and the profile file location as $CODEX_HOME/<name>.config.toml. On this PC CODEX_HOME is unset or empty, so we looked at .codex in the home folder. We listed names only in this PC's ~/.codex and did not open any file.
ls -1Ap "$HOME/.codex"Narrowed to the names that relate to auth and config:
auth.json
auth.json.bak_20260908
config.toml
config.toml.bak-20260804
installation_id
version.jsonThe same folder also held sessions/, log/, history.jsonl, several .sqlite files and more. auth.json looks like the file where login information is stored (judged by the name; we did not check the contents). A name auth.json.bak_20260908 was there too. We did not check who created it or what is in it, so treat it as if it may contain credentials. Don't share this folder wholesale or copy it to another PC.
5. Where usage is shown
Neither codex --help nor codex login --help had a command that shows usage or rate limits. The official documentation's slash command list does.
https://developers.openai.com/codex/cli/slash-commands redirects to https://learn.chatgpt.com/docs/developer-commands?surface=cli (checked 2026-09-17). From the document:
/status Display session configuration and token usage. Confirm the active model, approval policy, writable roots, and remaining context capacity.
/usage View account token usage or use a rate-limit reset. Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI.The same page also carried /status Show the chat ID, context usage, and rate limits. From the excerpts we pulled, there's no telling which screen's list that one belongs to.
So: run codex with no arguments to open the chat screen (the TUI), then type /status or /usage. We did not open the chat screen this round, so we are not printing either command's real output.
Results
| How we checked | Result on this PC | Note |
|---|---|---|
codex login status | Logged in using ChatGPT, exit code 0 | printed to stderr |
| Same command on the not-logged-in WSL codex | Not logged in, exit code 1 | from the WSL install note |
codex doctor --summary | [ok] auth auth is configured | 22 ok, 0 fail |
~/.codex | auth.json, config.toml and others present | names only |
| Usage | No usage command in the codex --help and codex login --help we checked. Official docs point to /status and /usage in the TUI | not run |
What failed
- We got no usage numbers. They live behind the chat screen, which falls outside this round's non-interactive scope.
What we did not test
- We did not see the real screens or numbers behind
/statusand/usage. - We did not check what
codex login statusprints when logged in with an API key (--with-api-key). - We did not open
auth.jsonto see its contents or structure. - We did not check
codex doctor --jsonoutput, or what the redacted entries are. - We did not check the
login statuswording on macOS or Linux, or on codex versions other than 0.153.4 (on Linux we only saw the not-logged-in case).