Skip to content

Loongphy/codex-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codex Auth

command list

codex-auth is a local-only command-line tool for switching Codex accounts.

  • It never calls OpenAI APIs; all operations happen locally on your machine.
  • It reads and updates local Codex files under ~/.codex (including sessions/ and auth files).

Install

  • Linux/macOS/WSL2:
curl -fsSL https://raw.githubusercontent.com/loongphy/codex-auth/main/scripts/install.sh | bash

The installer writes the install dir to your shell profile by default. Supported profiles: ~/.bashrc/~/.bash_profile/~/.profile, ~/.zshrc/~/.zprofile, ~/.config/fish/config.fish. Use --no-add-to-path to skip profile updates.

  • Windows (PowerShell):
irm https://raw.githubusercontent.com/loongphy/codex-auth/main/scripts/install.ps1 | iex

The installer adds the install dir to current/user PATH by default. Use -NoAddToPath to skip user PATH persistence.

Full Commands

codex-auth list # list all accounts
codex-auth add [--no-login] # add current account (runs `codex login` by default)
codex-auth switch [<email>] # switch active account (interactive or partial/fragment match)
codex-auth import <path> [--name <name>] # smart import: file -> single import, folder -> batch import
codex-auth remove # remove accounts (interactive multi-select)

Examples

List accounts (default table with borders):

codex-auth list

Add the currently logged-in Codex account:

codex-auth add

Import an auth.json backup:

codex-auth import /path/to/auth.json --name personal

Batch import from a folder:

codex-auth import /path/to/auth-exports

Switch accounts (interactive list shows email, 5h, weekly, last activity):

codex-auth switch               # arrow + number input

command switch

Switch account non-interactively (for scripts/other CLIs):

codex-auth switch user

If multiple accounts match, interactive selection is shown.

Remove accounts (interactive multi-select):

codex-auth remove

About

A local-only CLI tool to switch and manage Codex accounts

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors