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 installInstall envx CLI from npm
npm i -g envxtool-cli
envx --versionThis 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/.envKeep 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
}| Property | Meaning | Default on init |
|---|---|---|
| projectId | Selected envx project ID. | (set during prompts) |
| environment | Active environment slug. | empty string if none selected |
| currentEnvVersion | Tracked active version number. | 1 or selected env latest |
| envFilePath | Local env file path for pull/push. | .env |
| localBackupBeforePull | Create backup before pull. | true |
| localBackupPath | Backup file path. | .env.backup |
| alwaysOverrideEnvFile | Whether 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