Installation

Set up API and dashboard locally, then install the CLI from npm.

Prerequisites

  • Node.js 18 or newer
  • npm 9 or newer
  • MongoDB connection string
  • Redis instance

Install Local App Dependencies

git clone https://github.com/daniel-oluwadunsin/envx.git
cd envx

cd server && npm install
cd ../client && npm install

Install envx CLI from npm

npm i -g envxtool-cli
envx --version

This installs the published CLI globally so you can use envx in any project.

Configure Environment Files

cp server/.env.sample server/.env
cp client/.env.sample client/.env

Keep secrets out of git and rotate anything accidentally exposed.

envx-config.json in Project Root

Running envx init creates an envx-config.jsonfile in your current project root. envx reads this file for project and environment context in commands like pull,push, switch, and allgithost operations.

{
  "projectId": "<project-id>",
  "currentEnvVersion": 3,
  "environment": "staging",
  "localBackupBeforePull": true,
  "localBackupPath": ".env.backup",
  "envFilePath": ".env",
  "alwaysOverrideEnvFile": false
}
PropertyMeaningDefault on init
projectIdSelected envx project ID.(set during prompts)
environmentActive environment slug.empty string if none selected
currentEnvVersionTracked active version number.1 or selected env latest
envFilePathLocal env file path for pull/push..env
localBackupBeforePullCreate backup before pull.true
localBackupPathBackup file path..env.backup
alwaysOverrideEnvFileWhether pulls fully overwrite by default.false

File path is always your current working directory plusenvx-config.json. Run commands from your project root.

Run Each Surface

# Terminal 1
cd server
npm run start:dev

# Terminal 2
cd client
npm run dev

# Terminal 3
envx help