<?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>DEV Community: Chai Pin Zheng</title>
    <description>The latest articles on DEV Community by Chai Pin Zheng (@chaipinzheng).</description>
    <link>https://dev.to/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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3916916%2F1e970af8-3c27-4614-86f1-5a3e46c425b7.jpg</url>
      <title>DEV Community: Chai Pin Zheng</title>
      <link>https://dev.to/chaipinzheng</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chaipinzheng"/>
    <language>en</language>
    <item>
      <title>Installing Payload CMS Blocks Wired, Not Pasted</title>
      <dc:creator>Chai Pin Zheng</dc:creator>
      <pubDate>Wed, 24 Jun 2026 09:26:04 +0000</pubDate>
      <link>https://dev.to/chaipinzheng/installing-payload-cms-blocks-wired-not-pasted-aap</link>
      <guid>https://dev.to/chaipinzheng/installing-payload-cms-blocks-wired-not-pasted-aap</guid>
      <description>&lt;p&gt;When you build with Payload CMS and Next.js, reusable blocks are easy to imagine but annoying to distribute cleanly.&lt;/p&gt;

&lt;p&gt;A block is rarely just one component file. It usually needs a Payload block config, a frontend renderer, a collection registration, a renderer map entry, regenerated Payload types, and an updated admin import map. Copying the files is the easy part. Remembering the wiring every time is where projects drift.&lt;/p&gt;

&lt;p&gt;That is the problem Payload Components is trying to solve.&lt;/p&gt;

&lt;p&gt;Payload Components is an MIT registry and CLI for Payload v3 + Next.js blocks. The tagline is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Install Payload CMS blocks wired, not pasted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The basic flow looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx payload-components add hero-basic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A plain &lt;code&gt;shadcn add&lt;/code&gt; copies files into your project. &lt;code&gt;payload-components add&lt;/code&gt; copies the block source too, but it also performs the Payload-specific setup: it registers the block in the collection, maps the renderer, regenerates types and the admin import map, records install state, and leaves the result as a normal reviewable git diff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why copying files is not enough
&lt;/h2&gt;

&lt;p&gt;Payload blocks touch both editor schema and frontend rendering. If a registry only copies a component file, the install still leaves work behind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;import the block config&lt;/li&gt;
&lt;li&gt;register the block in the right collection&lt;/li&gt;
&lt;li&gt;import the frontend renderer&lt;/li&gt;
&lt;li&gt;add the renderer to the block map&lt;/li&gt;
&lt;li&gt;regenerate Payload types&lt;/li&gt;
&lt;li&gt;regenerate the admin import map&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those steps are small, but they repeat in every project. They are also easy to get slightly wrong when components evolve.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the CLI does
&lt;/h2&gt;

&lt;p&gt;The CLI treats each block as source code you own. It builds the registry item, installs files through the shadcn-compatible path, applies the supported Payload wiring, runs the post-install generation steps, and records install state so reruns converge instead of duplicating setup.&lt;/p&gt;

&lt;p&gt;The result is deliberately boring: a git diff you can review, edit, and keep.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current status
&lt;/h2&gt;

&lt;p&gt;The project is open source and MIT licensed. The catalog is intentionally small while the install contract is hardened around Payload v3 + Next.js projects shaped like the official website starter.&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site: &lt;a href="https://www.payload-components.xyz" rel="noopener noreferrer"&gt;https://www.payload-components.xyz&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/Ducksss/payload-components" rel="noopener noreferrer"&gt;https://github.com/Ducksss/payload-components&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://www.payload-components.xyz/docs" rel="noopener noreferrer"&gt;https://www.payload-components.xyz/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Catalog: &lt;a href="https://www.payload-components.xyz/components" rel="noopener noreferrer"&gt;https://www.payload-components.xyz/components&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback from Payload and Next.js teams would be useful, especially around repo shapes the installer should support next and which block families should be added first.&lt;/p&gt;

</description>
      <category>typescript</category>
    </item>
    <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://dev.to/chaipinzheng/stop-copying-codex-auth-files-use-codexhome-profiles-instead-4ncl</link>
      <guid>https://dev.to/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>
