Add, list, switch and remove saved Codex accounts from a Windows menu backed by
@loongphy/codex-auth. Login opens the Codex sign-in page. The adapter uses the
desktop client's bundled CLI when available and otherwise searches PATH.
- Windows x64 with Windows PowerShell 5.1 and Node.js 22 or later on PATH.
- Codex Desktop or Codex CLI installed separately.
- Keep
vendor/with the repository.
Version 0.1.0-rc.2 includes the Windows x64 build of
@loongphy/codex-auth 0.2.10.
Run from the repository root in PowerShell.
.\Codex-Accounts.cmd -Action check
.\Codex-Accounts.cmdClose Codex before adding or switching an account. In Desktop mode, a successful
login or account selection opens Codex Desktop automatically. Open Codex Desktop opens the installed app; the same action is available as
Codex-Accounts.cmd -Action open.
The manager defaults to the usual Codex home. Set CODEX_HOME in the current
session to use a separate profile.
$env:CODEX_HOME = Join-Path $PWD 'my-codex-profile'
New-Item -ItemType Directory -Force $env:CODEX_HOME | Out-Null
.\Codex-Accounts.cmd -Action list
.\Codex-Accounts.cmd -Action loginStart the client with the same CODEX_HOME. The manager saves successful logins
from a temporary sign-in profile.
.\codex-auth.cmd list --skip-api
.\codex-auth.cmd switch 'name@example.com'
.\codex-auth.cmd remove 'name@example.com'
.\codex-auth.cmd login --device-auth
node .\adapter\codex-account-info.mjs --skip-apiFor switch and remove, replace name@example.com with an account shown by list.
The menu displays saved account metadata. Run
node .\adapter\codex-account-info.mjs to refresh usage and subscription data.
CODEX_ADAPTER_MODE accepts auto (default), desktop, or cli.
Desktop mode uses %LOCALAPPDATA%\OpenAI\Codex\bin\codex.exe. CLI mode searches
PATH, excluding the adapter and aliases of its wrapper. Use an absolute path
to override executable discovery. CLI mode and an explicit executable override
leave starting the client to you.
$env:CODEX_ADAPTER_EXECUTABLE = Read-Host 'Path to the Codex executable'
.\adapter\codex.cmd --adapter-checkSee Codex authentication for browser sign-in and credential storage, and Loongphy/codex-auth for the upstream account manager.