<?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: Rahul Chourasiya</title>
    <description>The latest articles on DEV Community by Rahul Chourasiya (@rcmade).</description>
    <link>https://dev.to/rcmade</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%2F4260379%2Fd0a64751-b4d4-4a30-a511-714b8e414445.png</url>
      <title>DEV Community: Rahul Chourasiya</title>
      <link>https://dev.to/rcmade</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rcmade"/>
    <language>en</language>
    <item>
      <title>Why I Stopped Using .env Files (And What I Use Instead)</title>
      <dc:creator>Rahul Chourasiya</dc:creator>
      <pubDate>Mon, 23 Nov 2026 12:38:21 +0000</pubDate>
      <link>https://dev.to/rcmade/why-i-stopped-using-env-files-and-what-i-use-instead-1p1f</link>
      <guid>https://dev.to/rcmade/why-i-stopped-using-env-files-and-what-i-use-instead-1p1f</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flr02r2jfe8ihklrkhlsr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flr02r2jfe8ihklrkhlsr.png" alt=" " width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like most developers, our team relied on &lt;code&gt;.env&lt;/code&gt; files for years. It felt simple: create a &lt;code&gt;.env.local&lt;/code&gt;, put your API keys in it, and add it to &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In practice, that system always breaks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Slack DM leak:&lt;/strong&gt; When a new engineer joins, someone pastes the staging database URL into a private Slack thread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Git commit accident:&lt;/strong&gt; A developer renames a file or initializes a new subfolder, forgets to add &lt;code&gt;.env&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;, and pushes production keys to GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment drift:&lt;/strong&gt; Staging has variables that dev doesn't, causing the classic &lt;em&gt;"it worked on my machine"&lt;/em&gt; outage.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The In-Memory Approach
&lt;/h3&gt;

&lt;p&gt;Instead of storing secrets in plaintext files on disk, we can fetch encrypted credentials over TLS and inject them &lt;strong&gt;directly into the child process memory&lt;/strong&gt; at runtime.&lt;/p&gt;

&lt;p&gt;I built a CLI called &lt;strong&gt;Ray Secrets&lt;/strong&gt; (&lt;code&gt;@rcmade/ray&lt;/code&gt;) to make this zero-friction:&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="c"&gt;# 1. Install &amp;amp; Authenticate&lt;/span&gt;
npm install -g @rcmade/ray
ray login

&lt;span class="c"&gt;# 2. Link your project (auto-imports existing .env if present)&lt;/span&gt;
ray init

&lt;span class="c"&gt;# 3. Launch your app with in-memory injection&lt;/span&gt;
ray run -e development -- npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why this changes local workflow:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Zero Disk Exposure:&lt;/strong&gt; The child process receives &lt;code&gt;process.env&lt;/code&gt; in RAM. Nothing is written to &lt;code&gt;.env&lt;/code&gt;. When the server stops, the secrets disappear from memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local AST Healing:&lt;/strong&gt; If you still need a local file for legacy tools, &lt;code&gt;ray sync&lt;/code&gt; reconciles differences and automatically repairs broken syntax without stripping comments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production Proposals:&lt;/strong&gt; Changes to production secrets can require review before landing, just like a GitHub Pull Request.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're tired of passing around &lt;code&gt;.env&lt;/code&gt; files, give it a spin:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://secrets.rcmade.io" rel="noopener noreferrer"&gt;https://secrets.rcmade.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CLI: &lt;code&gt;npm i -g @rcmade/ray&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How is your team currently handling local and staging secrets?&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>aws</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
