Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codauth — Multi-account manager for AI coding tools

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.

screenshot

Features

  • 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

Install

Prerequisites

  • Go 1.23+ (only needed for build/install — runtime is a single binary)

Option A: Go install (easiest)

go install github.com/07rjain/codauth@latest

Make sure ~/go/bin (or $GOPATH/bin) is in your PATH:

export PATH="$HOME/go/bin:$PATH"

Option B: Clone and build

git clone https://github.com/07rjain/codauth.git
cd codauth
make install

Binary goes to ~/.local/bin as both codex-auth-tui and codauth. Ensure it's in your PATH:

export PATH="$HOME/.local/bin:$PATH"

Option C: Download a release

Download the latest binary from the releases page, move it into your PATH, and rename to codauth.

macOS: gatekeeper

If macOS blocks the unsigned binary:

sudo xattr -d com.apple.quarantine ~/.local/bin/codauth

Quick start

# 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

Supported providers

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

Commands

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

How it works

Each profile stores a named snapshot of a provider's auth file. When you switch profiles:

  1. The current auth file is read and backed up with a timestamp
  2. The selected profile's saved auth is written to the provider's auth path
  3. 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/.

Safety

  • 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

Build from source

git clone https://github.com/07rjain/codauth.git
cd codauth
go mod tidy
go test ./...
go build -o bin/codex-auth-tui .

Troubleshooting

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)

Related projects

  • codex-auth — the original CLI switcher that inspired this
  • CodexBar — macOS menu bar tool for Codex usage visibility

Contributing

Contributions welcome! Please open an issue or PR.

go test ./...   # all tests must pass

License

MIT

About

Save, switch, and manage multiple accounts across AI coding providers — Codex, Claude, OpenAI, Cursor, Copilot, Gemini, Windsurf, Grok, Perplexity, DeepSeek. CLI + TUI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages