codex-mirror
v0.1.8
Published
Local multi-account manager for Codex CLI with isolated runtime/auth state and TUI clone management.
Readme
codex-mirror
codex-mirror is a local multi-account manager for Codex.
It creates centrally stored clones, each with isolated runtime and isolated auth/session/config state.
This project currently targets official Codex only (Phase 1). Multi-provider support is planned for Phase 2.
Unofficial community tool. Not affiliated with OpenAI.
What you get
- Screen-based TUI (
codex-mirror) with clone lifecycle management - Centralized clone storage under one global home
- Per-clone runtime pinning (copied from currently installed Codex)
- Per-clone isolated
HOMEand XDG directories - Wrapper command per clone name
- Built-in diagnostics (
doctor) for runtime/wrapper/writable/auth checks - Safety protections:
- Strict clone-name validation
- Wrapper path confinement (no path traversal)
- Registry lock + atomic writes
- Transactional clone create/update/remove with rollback
Requirements
- macOS/Linux (Node.js 20+)
codexavailable onPATH
Quick start
Direct run (no install):
npx codex-mirror@latestGlobal install:
npm install -g codex-mirror
codex-mirrorLocal development:
npm install
npm run build
node dist/cli.jsDemo

npx codex-mirror@latestGIF source path: docs/assets/demo.gif
Direct link (for npm): https://raw.githubusercontent.com/Mohit-Patil/codex-mirror/main/docs/assets/demo.gif
From the TUI main menu:
- Choose
Quick Clone. - Optionally run login for that clone.
- Use
Manage Clonesto run, update, remove. - Use
Diagnosticsfor health checks. - Use
Shell PATH Setupto auto-configure wrapper discovery. - Use
Star on GitHubto open the repository page. - Choose
Exitfor a finalStar and Exit/Skip and Exitprompt.
CLI usage
Examples below use the installed command.
For local development from source, replace codex-mirror with node dist/cli.js.
# Create clone (default root: ~/.codex-mirror/clones/<name>)
codex-mirror create --name work
# List clones
codex-mirror list
codex-mirror list --full
codex-mirror list --json
# Run clone
codex-mirror run work
codex-mirror run work -- --model o3
# Login/logout
codex-mirror login work
codex-mirror logout work
# Health checks
codex-mirror doctor
codex-mirror doctor work --json
# Updates
codex-mirror update work
codex-mirror update --all
# Remove clone
codex-mirror remove work
# Reinstall wrappers
codex-mirror wrapper install
# Check/setup PATH for wrapper commands
codex-mirror path status
codex-mirror path setupData layout
Default locations:
- Mirror home:
~/.codex-mirror - Registry:
~/.codex-mirror/registry.json - Clone root:
~/.codex-mirror/clones/<clone-name> - Wrapper binaries:
~/.local/bin/<clone-name>
Per clone:
<clone-root>/
.codex-mirror/
clone.json
runtime/
home/
.codex/
.config/
.local/share/
.cache/
logs/Path overrides:
CODEX_MIRROR_HOME(changes global root)CODEX_MIRROR_BIN_DIR(changes wrapper output dir)
After adding clones, if wrappers are not found by name:
codex-mirror path setupThen reload shell (example for bash):
. ~/.bashrcSafety model
- Clone names are validated and must be filesystem-safe.
- Wrapper paths are forced to remain inside configured wrapper directory.
- Registry updates are lock-protected and written atomically.
- Create/update/remove operations include rollback to avoid partial state.
- Health checks use bounded concurrency and auth timeouts.
Detailed docs:
docs/ARCHITECTURE.mddocs/SECURITY.mddocs/OPERATIONS.mddocs/TROUBLESHOOTING.mddocs/ROADMAP.mddocs/RELEASE.md
Development
npm run checkCommunity
- Contributing guide:
CONTRIBUTING.md - Code of Conduct:
CODE_OF_CONDUCT.md - Security policy:
SECURITY.md - Support info:
SUPPORT.md
Maintainer release flow
- Ensure
mainis green in CI. - Update version:
npm version patch - Push commit + tag:
git push origin main --follow-tags - Tag trigger
v*runs.github/workflows/release.ymland publishes to npm. - Release workflow enforces
tag version == package.json version(for example:v0.1.5requires"version": "0.1.5").
