Switch Codex accounts quickly when limits hit.
Codex is effectively single-active-auth on one machine. When one account hits its window, users often repeat logout and login loops across accounts. cma removes that friction with safe account switching, encrypted storage, and encrypted backup and restore.
Repository: https://github.com/prakersh/codexmultiauth
If you use multiple Codex accounts, setup is usually easy. Repeated switching is not. Manual auth-file handling is slow and error-prone.
cma provides:
- encrypted credential storage at rest
- atomic account activation with rollback
- encrypted backups with guided restore
- confidence-tiered usage reporting
- CLI and TUI workflows
cma is built for users who need fast account rotation:
- power users handling multiple accounts
- consultants or agencies switching client identities
- teams that want fewer manual auth mistakes
- Save current Codex auth into an encrypted vault:
cma save - Switch active account safely:
cma activate <selector> - Create encrypted backups:
cma backup <encrypthash/pass> <name|abspath> - Restore selectively or all-at-once:
cma restore ... [--all] - View account usage with confidence labels:
cma usage <selector|all> - Show limits for all saved accounts:
cma limits - Run interactive terminal UI:
cma tui
- Go
1.24.2 codexCLI onPATH(required forcma new)- Optional OS keyring support (CMA falls back to file key storage when needed)
go build -o cma .
./cma --help# Save current Codex account (encrypted)
./cma save
# List saved accounts
./cma list
# Activate an account by selector
./cma activate 1# Usage for one account
./cma usage work
# Usage for all accounts
./cma usage all
# Limits view for all accounts
./cma limits# Encrypted backup (interactive passphrase prompt)
./cma backup prompt weekly-backup
# Restore with interactive selection
./cma restore prompt weekly-backup
# Restore all entries atomically with conflict policy
./cma restore prompt weekly-backup --all --conflict overwrite./cma tuiUse ./app.sh for build, test, verification, and release workflows.
# Quick pre-commit checks
./app.sh --smoke
# Full host-shell verification matrix
./app.sh --verify
# Full verification in isolated temp HOME/XDG/CODEX
./app.sh --verify-sandbox
# Build local binary (./bin/cma)
./app.sh --build
# Run cma through orchestrator
./app.sh --run -- version
./app.sh --run -- tui
# Cross-platform release artifacts (./dist)
./app.sh --release
# Draft-first GitHub release publish
./app.sh --publish-release --draft --notes-file docs/release-notes.mdExecution order for combined flags:
deps -> clean -> fmt -> lint -> test -> race -> cover -> build -> smoke -> verify -> verify-sandbox -> release -> publish-release -> run
./test.sh is a thin wrapper over ./app.sh.
./test.sh quick
./test.sh full
./test.sh prerelease
./test.sh publish -- --notes-file docs/release-notes.mdMappings:
./test.sh quick->./app.sh --smoke./test.sh full->./app.sh --verify-sandbox./test.sh prerelease->./app.sh --verify-sandbox --release./test.sh publish->./app.sh --publish-release --draft
Recommended path:
# 1. Verify in isolated temp HOME/XDG/CODEX
./app.sh --verify-sandbox
# 2. Build dist artifacts and checksums
./app.sh --release
# 3. Create GitHub draft release with assets
./app.sh --publish-release --draft --notes-file docs/release-notes.mdTo publish a draft release after review:
gh release edit v$(cat cmd/VERSION) --draft=falsecma listcma usage <selector|all>cma limitscma savecma new [--device-auth]cma activate <selector>cma delete <selector>cma backup <encrypthash/pass> <name|abspath> [--allow-plain-pass-arg]cma restore <encrypthash/pass> <pathtobackup|name> [--all] [--conflict ask|overwrite|skip|rename] [--allow-plain-pass-arg]cma version [--short]cma tui
Full syntax and examples: docs/COMMANDS.md
cma version prints app version and public project links.
./cma version
./cma version --shortVersion resolution order:
cmd.Version(build-time ldflags override)cmd/VERSION- fallback
dev
Example release build metadata injection:
VERSION=$(cat cmd/VERSION)
COMMIT=$(git rev-parse --short HEAD)
DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
go build -ldflags "-X github.com/prakersh/codexmultiauth/cmd.Version=${VERSION} -X github.com/prakersh/codexmultiauth/cmd.Commit=${COMMIT} -X github.com/prakersh/codexmultiauth/cmd.Date=${DATE}" -o cma .- Vault and backup encryption:
XChaCha20-Poly1305 - Backup key derivation:
Argon2id - Strict filesystem permissions: files
0600, dirs0700 - Mutations use lock + atomic write + verification + rollback
- Normal command output avoids secret values
Details: docs/SECURITY.md
cma usage and cma limits report:
confirmedbest_effortunknown
This prevents false precision when no stable machine-readable quota source is available.