Save, switch, and manage multiple accounts across AI coding providers — without re-logging in every time.
Why? If you juggle multiple ChatGPT Plus subscriptions, Claude Pro accounts, or any AI coding accounts, you know the drill: find the right auth file, copy it, paste it, hope it works. codauth makes it instant and safe.
- Multi-provider — Codex, Claude, OpenAI, Cursor, Copilot, Gemini, Grok, Windsurf, Perplexity, DeepSeek
- Named profiles — save each account with an alias like
work,personal,client-a - Instant switching — swap auth files with automatic backup
- Per-provider active tracking — independent active profiles per provider
- Usage visibility — see 5-hour and weekly usage before switching
- CLI + TUI — full CLI for scripting, TUI dashboard for browsing
- Safe — backups before every switch, tokens redacted from output
- Go 1.23+ (only needed for build/install — runtime is a single binary)
go install github.com/07rjain/codauth@latestMake sure ~/go/bin (or $GOPATH/bin) is in your PATH:
export PATH="$HOME/go/bin:$PATH"git clone https://github.com/07rjain/codauth.git
cd codauth
make installBinary goes to ~/.local/bin as both codex-auth-tui and codauth. Ensure it's in your PATH:
export PATH="$HOME/.local/bin:$PATH"Download the latest binary from the releases page, move it into your PATH, and rename to codauth.
If macOS blocks the unsigned binary:
sudo xattr -d com.apple.quarantine ~/.local/bin/codauth# Save your current Codex account
codauth save personal
# Save a Claude account
codauth save work --provider claude
# List all saved profiles
codauth list
# Switch between accounts
codauth use personal
codauth use work
# See which profile is active
codauth current
codauth current --provider claude
# Fetch usage data
codauth usage personal
codauth refresh --all
# List supported providers and their auth file locations
codauth providers
# Run diagnostics
codauth doctor
# Launch the TUI dashboard
codauth| Provider | Auth file | Identifies by |
|---|---|---|
| codex | ~/.codex/auth.json |
access_token |
| claude | ~/.claude/credentials.json |
sessionKey |
| openai | ~/.openai/auth.json |
accessToken |
| cursor | ~/.cursor/Cookie |
Cookie value |
| copilot | ~/.config/github-copilot/hosts.json |
oauth_token |
| gemini | ~/.config/gcloud/... |
(varies) |
| windsurf | ~/.windsurf/auth.json |
accessToken |
| grok | ~/.grok/auth.json |
access_token |
| perplexity | ~/.perplexity/auth.json |
(varies) |
| deepseek | ~/.deepseek/auth.json |
access_token |
| Command | Description |
|---|---|
codauth |
Launch the TUI dashboard |
codauth list |
List all saved profiles |
codauth list --provider claude |
List profiles for a specific provider |
codauth list --json |
List profiles as JSON |
codauth save <alias> |
Save current Codex auth as a profile |
codauth save <alias> --provider claude |
Save current Claude auth |
codauth use <alias> |
Switch to a saved profile |
codauth current |
Show active Codex profile |
codauth current --provider claude |
Show active Claude profile |
codauth import <path> --alias <alias> |
Import an auth file as a profile |
codauth export <alias> --out <dir> |
Export a profile's auth file |
codauth remove <alias> |
Delete a profile |
codauth rename <old> <new> |
Rename a profile |
codauth usage <alias> |
Fetch and display usage data |
codauth refresh <alias> |
Refresh cached usage data |
codauth refresh --all |
Refresh usage for all profiles |
codauth providers |
List supported providers |
codauth config usage --source api |
Enable API usage refresh |
codauth doctor |
Run diagnostics |
Each profile stores a named snapshot of a provider's auth file. When you switch profiles:
- The current auth file is read and backed up with a timestamp
- The selected profile's saved auth is written to the provider's auth path
- The registry is updated so active profile tracking is per-provider
Auth snapshots live in ~/.codex/auth-manager/profiles/<alias>/auth.json (restrictive permissions). Backups live in ~/.codex/auth-manager/backups/.
- Auth files are treated as secrets — tokens are redacted from all output
- Active auth is backed up before every switch
- API usage refresh is off by default (opt-in via
codauth config usage --source api) - Refuses to delete the currently active profile
- Aliases validated: 1–64 chars, letters/numbers/dots/underscores/dashes
git clone https://github.com/07rjain/codauth.git
cd codauth
go mod tidy
go test ./...
go build -o bin/codex-auth-tui .| Problem | Fix |
|---|---|
command not found: codauth |
Add ~/.local/bin or ~/go/bin to your PATH |
| macOS: "unidentified developer" | sudo xattr -d com.apple.quarantine $(which codauth) |
| Codex CLI doesn't pick up change | Restart the Codex daemon (codex daemon restart) |
- codex-auth — the original CLI switcher that inspired this
- CodexBar — macOS menu bar tool for Codex usage visibility
Contributions welcome! Please open an issue or PR.
go test ./... # all tests must passMIT