codex-auth import <path> [--alias <alias>]
codex-auth import --cpa [<path>] [--alias <alias>]
codex-auth import --purge [<path>]- A file path imports one auth/config file.
- A directory path imports direct child
.jsonfiles from that directory. - Directory imports are non-recursive.
--aliasapplies only to a single imported file.- Directory import ignores
--alias.
--cpa imports flat CLIProxyAPI token JSON.
- Without a path, it scans
~/.cli-proxy-api/*.json. - With a directory path, it scans direct child
.jsonfiles from that directory. - With a file path, it imports that single CPA file.
- CPA input is converted in memory to the current auth snapshot format before writing managed account files.
--cpacannot be combined with--purge.
--purge rebuilds registry.json from existing auth snapshots.
- Without a path, it scans
~/.codex/accounts/. - With a path, it scans auth files from that directory.
- It also tries to import the current
~/.codex/auth.jsonlast. - It clears and rebuilds account records, stored usage, active-account activation time, and local rollout dedupe state.
- It does not delete old snapshot files or backups.
Use --purge as a recovery tool when the registry index is out of sync with the auth files on disk.
stdoutreceives scan lines, imported/updated rows, and summaries.stderrreceives skipped rows and warnings.- Parse failures render as
InvalidJSON. - Validation failures keep explicit names such as
MissingEmailorMissingChatgptUserId.