Stop copying Codex auth files: use CODEX_HOME profiles instead

If you use Codex with more than one account, repo context, or local setup, the usual workaround gets old quickly: copy one auth.json somewhere safe, swap it back later, and hope you did not overwrite the wrong state.

I wanted something boring and expl…


This content originally appeared on DEV Community and was authored by Chai Pin Zheng

If you use Codex with more than one account, repo context, or local setup, the usual workaround gets old quickly: copy one auth.json somewhere safe, swap it back later, and hope you did not overwrite the wrong state.

I wanted something boring and explicit, so I made codex-profiles: a small open-source helper that launches Codex CLI or Codex Desktop with a named CODEX_HOME.

GitHub: https://github.com/Ducksss/codex-profiles

The problem

Codex keeps useful local state under CODEX_HOME: auth, config, sessions, plugins, logs, and other local files. That is convenient for one identity, but awkward when you want clean separation between:

  • work and personal accounts
  • experimental and stable config
  • different plugin sets
  • repo-specific sessions
  • short-lived test logins

You can script around it manually, but copying auth files is a brittle workflow.

The workflow

Install with Homebrew:

brew install Ducksss/tap/codex-profile

Create or log into a profile:

codex-profile login work

Run Codex CLI using that profile:

codex-profile cli work exec "review this repo"

Open Codex Desktop with a separate local profile:

codex-profile app personal

Each profile maps to its own CODEX_HOME, so the local Codex state stays isolated without moving files around by hand.

Why this shape

The tool is intentionally small. It does not try to wrap the entire Codex workflow or invent a new config model. It just makes the boundary explicit:

CODEX_HOME=<profile-directory> codex ...

That means the underlying Codex behavior stays familiar, while profile switching becomes a repeatable command.

What it is useful for

  • keeping work and personal Codex auth separate
  • testing new Codex config without touching your main setup
  • keeping separate plugin/session state per context
  • launching Desktop or CLI against the same named profile
  • avoiding accidental auth.json swaps

Try it

brew install Ducksss/tap/codex-profile
codex-profile login work
codex-profile cli work exec "summarize this repo"

The project is open source and dependency-light. Feedback from other Codex users would be useful, especially around naming, install friction, and profile workflows I have missed.

Repo: https://github.com/Ducksss/codex-profiles


This content originally appeared on DEV Community and was authored by Chai Pin Zheng


Print Share Comment Cite Upload Translate Updates
APA

Chai Pin Zheng | Sciencx (2026-05-07T02:48:40+00:00) Stop copying Codex auth files: use CODEX_HOME profiles instead. Retrieved from https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/

MLA
" » Stop copying Codex auth files: use CODEX_HOME profiles instead." Chai Pin Zheng | Sciencx - Thursday May 7, 2026, https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/
HARVARD
Chai Pin Zheng | Sciencx Thursday May 7, 2026 » Stop copying Codex auth files: use CODEX_HOME profiles instead., viewed ,<https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/>
VANCOUVER
Chai Pin Zheng | Sciencx - » Stop copying Codex auth files: use CODEX_HOME profiles instead. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/
CHICAGO
" » Stop copying Codex auth files: use CODEX_HOME profiles instead." Chai Pin Zheng | Sciencx - Accessed . https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/
IEEE
" » Stop copying Codex auth files: use CODEX_HOME profiles instead." Chai Pin Zheng | Sciencx [Online]. Available: https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/. [Accessed: ]
rf:citation
» Stop copying Codex auth files: use CODEX_HOME profiles instead | Chai Pin Zheng | Sciencx | https://www.scien.cx/2026/05/07/stop-copying-codex-auth-files-use-codex_home-profiles-instead/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.