Skip to content

About

Windows account menu for adding, listing, switching and removing saved Codex accounts through codex-auth.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Codex Desktop Auth Adapter

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.

Requirements and installation

  • 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.cmd

Close 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.

Separate profile

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 login

Start the client with the same CODEX_HOME. The manager saves successful logins from a temporary sign-in profile.

Direct commands

.\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-api

For 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.

Choose the Codex executable

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-check

See Codex authentication for browser sign-in and credential storage, and Loongphy/codex-auth for the upstream account manager.

About

Windows account menu for adding, listing, switching and removing saved Codex accounts through codex-auth.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages