<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Chai Pin Zheng</title>
    <description>The latest articles on Forem by Chai Pin Zheng (@chaipinzheng).</description>
    <link>https://forem.com/chaipinzheng</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916916%2F1e970af8-3c27-4614-86f1-5a3e46c425b7.jpg</url>
      <title>Forem: Chai Pin Zheng</title>
      <link>https://forem.com/chaipinzheng</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/chaipinzheng"/>
    <language>en</language>
    <item>
      <title>Stop copying Codex auth files: use CODEX_HOME profiles instead</title>
      <dc:creator>Chai Pin Zheng</dc:creator>
      <pubDate>Thu, 07 May 2026 02:48:40 +0000</pubDate>
      <link>https://forem.com/chaipinzheng/stop-copying-codex-auth-files-use-codexhome-profiles-instead-4ncl</link>
      <guid>https://forem.com/chaipinzheng/stop-copying-codex-auth-files-use-codexhome-profiles-instead-4ncl</guid>
      <description>&lt;p&gt;If you use Codex with more than one account, repo context, or local setup, the usual workaround gets old quickly: copy one &lt;code&gt;auth.json&lt;/code&gt; somewhere safe, swap it back later, and hope you did not overwrite the wrong state.&lt;/p&gt;

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

&lt;p&gt;GitHub: &lt;a href="https://github.com/Ducksss/codex-profiles" rel="noopener noreferrer"&gt;https://github.com/Ducksss/codex-profiles&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

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

&lt;ul&gt;
&lt;li&gt;work and personal accounts&lt;/li&gt;
&lt;li&gt;experimental and stable config&lt;/li&gt;
&lt;li&gt;different plugin sets&lt;/li&gt;
&lt;li&gt;repo-specific sessions&lt;/li&gt;
&lt;li&gt;short-lived test logins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can script around it manually, but copying auth files is a brittle workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow
&lt;/h2&gt;

&lt;p&gt;Install with Homebrew:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;Ducksss/tap/codex-profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create or log into a profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex-profile login work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run Codex CLI using that profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex-profile cli work &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="s2"&gt;"review this repo"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open Codex Desktop with a separate local profile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex-profile app personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each profile maps to its own &lt;code&gt;CODEX_HOME&lt;/code&gt;, so the local Codex state stays isolated without moving files around by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this shape
&lt;/h2&gt;

&lt;p&gt;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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;CODEX_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;profile-directory&amp;gt; codex ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means the underlying Codex behavior stays familiar, while profile switching becomes a repeatable command.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is useful for
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;Ducksss/tap/codex-profile
codex-profile login work
codex-profile cli work &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="s2"&gt;"summarize this repo"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/Ducksss/codex-profiles" rel="noopener noreferrer"&gt;https://github.com/Ducksss/codex-profiles&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devtools</category>
      <category>openai</category>
      <category>cli</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
