<?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: Ugesh Praavin D</title>
    <description>The latest articles on DEV Community by Ugesh Praavin D (@ugesh_praavin).</description>
    <link>https://dev.to/ugesh_praavin</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%2F4135536%2F5da7597a-8ce0-4b3a-95d2-2419a2654e8a.jpg</url>
      <title>DEV Community: Ugesh Praavin D</title>
      <link>https://dev.to/ugesh_praavin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ugesh_praavin"/>
    <language>en</language>
    <item>
      <title>I Built a CLI to Automate Firebase Setup for JavaScript Projects</title>
      <dc:creator>Ugesh Praavin D</dc:creator>
      <pubDate>Mon, 21 Sep 2026 10:39:19 +0000</pubDate>
      <link>https://dev.to/ugesh_praavin/i-built-a-cli-to-automate-firebase-setup-for-javascript-projects-73f</link>
      <guid>https://dev.to/ugesh_praavin/i-built-a-cli-to-automate-firebase-setup-for-javascript-projects-73f</guid>
      <description>&lt;p&gt;I Built a CLI to Automate Firebase Setup for JavaScript Projects&lt;/p&gt;

&lt;p&gt;If you've connected Firebase to multiple JavaScript projects, you've probably repeated the same setup steps more times than you'd like.&lt;/p&gt;

&lt;p&gt;Create or select a Firebase project.&lt;/p&gt;

&lt;p&gt;Create a Firebase Web App.&lt;/p&gt;

&lt;p&gt;Retrieve the Firebase configuration.&lt;/p&gt;

&lt;p&gt;Set up environment variables.&lt;/p&gt;

&lt;p&gt;Create the Firebase initialization file.&lt;/p&gt;

&lt;p&gt;Make sure everything matches the framework you're using.&lt;/p&gt;

&lt;p&gt;Then do it all again for the next project.&lt;/p&gt;

&lt;p&gt;I wanted to automate that workflow, so I built FireConfig.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS FIRECONFIG?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FireConfig is an open-source CLI that automates Firebase configuration for JavaScript and TypeScript projects.&lt;/p&gt;

&lt;p&gt;You can start it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx fireconfig init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;FireConfig detects the project environment and guides you through the Firebase configuration process.&lt;/p&gt;

&lt;p&gt;The goal isn't to hide what's happening. It's to automate the repetitive parts while keeping important decisions under the developer's control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT DOES IT DO?&lt;/strong&gt;&lt;/p&gt;

&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%2Fhtshcs72cj4quxmvip8j.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%2Fhtshcs72cj4quxmvip8j.png" alt="output" width="800" height="806"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The workflow looks roughly like this:&lt;/p&gt;

&lt;p&gt;Project&lt;br&gt;
  ↓&lt;br&gt;
Detect framework&lt;br&gt;
  ↓&lt;br&gt;
Check Firebase CLI&lt;br&gt;
  ↓&lt;br&gt;
Authenticate with Firebase&lt;br&gt;
  ↓&lt;br&gt;
Select or create Firebase project&lt;br&gt;
  ↓&lt;br&gt;
Select or create Firebase Web App&lt;br&gt;
  ↓&lt;br&gt;
Retrieve Firebase configuration&lt;br&gt;
  ↓&lt;br&gt;
Configure environment variables&lt;br&gt;
  ↓&lt;br&gt;
Generate Firebase initialization&lt;/p&gt;

&lt;p&gt;Instead of manually going through these steps every time, FireConfig handles the repetitive parts for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FRAMEWORK SUPPORT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FireConfig currently supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React + Vite&lt;/li&gt;
&lt;li&gt;React + Create React App&lt;/li&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;React Native Android&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Expo projects can currently be detected, but the Expo configuration workflow is not implemented yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SAFE ENVIRONMENT CONFIGURATION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the things I wanted to get right was handling existing .env.local files safely.&lt;/p&gt;

&lt;p&gt;Imagine you already have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
API_URL=https://api.example.com
FEATURE_FLAG=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When FireConfig configures Firebase, it shouldn't simply delete or replace that file.&lt;/p&gt;

&lt;p&gt;Instead, it can add the Firebase variables while preserving the existing configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;API_URL=https://api.example.com
FEATURE_FLAG=true

VITE_FIREBASE_API_KEY=...
VITE_FIREBASE_AUTH_DOMAIN=...
VITE_FIREBASE_PROJECT_ID=...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Comments, unrelated variables, and existing configuration are preserved.&lt;/p&gt;

&lt;p&gt;If a Firebase variable already exists with a different value, FireConfig asks before replacing it.&lt;/p&gt;

&lt;p&gt;Running the configuration again with the same values is also designed to be idempotent, so it doesn't keep duplicating variables.&lt;/p&gt;

&lt;p&gt;FIREBASE PROJECT AND WEB APP CREATION&lt;/p&gt;

&lt;p&gt;Another part of the workflow I wanted to simplify was Firebase resource setup.&lt;/p&gt;

&lt;p&gt;If a user doesn't have a Firebase project, FireConfig can offer to create one.&lt;/p&gt;

&lt;p&gt;If the selected Firebase project doesn't have a Web App, FireConfig can offer to create one.&lt;/p&gt;

&lt;p&gt;But it doesn't silently create cloud resources.&lt;/p&gt;

&lt;p&gt;The user is asked for confirmation before creating external Firebase resources.&lt;/p&gt;

&lt;p&gt;That distinction is important for a developer tool that operates on someone's Firebase account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FRAMEWORK-AWARE ENVIRONMENT VARIABLES&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Different frameworks handle environment variables differently.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vite:
import.meta.env.VITE_FIREBASE_API_KEY

Create React App:
process.env.REACT_APP_FIREBASE_API_KEY

Next.js:
process.env.NEXT_PUBLIC_FIREBASE_API_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;FireConfig detects the project framework and generates the Firebase configuration using the appropriate environment-variable access pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GENERATED FIREBASE CONFIGURATION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FireConfig generates:&lt;/p&gt;

&lt;p&gt;src/firebase/config.js&lt;/p&gt;

&lt;p&gt;The generated configuration reads Firebase values from environment variables rather than embedding the configuration values directly into the source file.&lt;/p&gt;

&lt;p&gt;It also handles repeated initialization safely.&lt;/p&gt;

&lt;p&gt;The goal is to make the generated configuration usable while keeping it framework-aware and repeatable.&lt;br&gt;
**&lt;br&gt;
FIRECONFIG DOCTOR**&lt;/p&gt;

&lt;p&gt;FireConfig also includes a diagnostic command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
fireconfig doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The doctor checks the Firebase configuration and framework-specific setup and reports configuration problems that need attention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHY I BUILT IT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The idea behind FireConfig is pretty simple:&lt;/p&gt;

&lt;p&gt;"Connecting Firebase to a project shouldn't require repeating the same configuration work every time."&lt;/p&gt;

&lt;p&gt;I wanted to turn that repetitive setup process into a reusable developer tool.&lt;/p&gt;

&lt;p&gt;The project is still evolving, and there are more Firebase workflows I want to support in future releases.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;TRY FIRECONFIG&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Install it globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; fireconfigcli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or run it directly with npx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx fireconfig init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;LINKS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/fireconfigcli" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/fireconfigcli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/Ugesh-Praavin/fireconfig" rel="noopener noreferrer"&gt;https://github.com/Ugesh-Praavin/fireconfig&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FireConfig is open source and released under the MIT license.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT'S NEXT?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are still several things I want to improve and expand.&lt;/p&gt;

&lt;p&gt;In particular, I'd like to continue improving framework-specific workflows and make Firebase setup even more predictable across different project environments.&lt;/p&gt;

&lt;p&gt;If you work with Firebase regularly, I'd be interested to know:&lt;/p&gt;

&lt;p&gt;What's the most repetitive part of your Firebase setup workflow?&lt;/p&gt;

&lt;p&gt;Maybe that's something FireConfig can automate next.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
      <category>firebase</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
