$CLI Tool for Node.js

Manage environment variables with confidence

EnvMage is a powerful CLI that simplifies .env management — validate against templates, sync across environments, scan your codebase, and generate TypeScript types. All from your terminal.

# MIT licensed · Zero config to start · Works with any Node.js project

016Core commands
02100%Type safety
030Runtime dependencies

env-mage — bash

1
$ npm install -g env-mage
2
$ env-mage init
3
✓ Created .env.example from .env
4
✓ Added required variable annotations
5
$ env-mage validate
6
✓ All required variables present
7
✓ All variables match expected format
8
$ env-mage typegen
9
✓ TypeScript definitions generated at src/env.d.ts
10
$ env-mage scan
11
✓ Found 12 environment variables in codebase
12
✓ All used variables are defined in .env

typegen

src/env.d.ts

validated

12/12 vars

env-mage init
env-mage validate
env-mage typegen
env-mage sync
env-mage scan
env-mage json
env-mage diff
env-mage init
env-mage validate
env-mage typegen
env-mage sync
env-mage scan
env-mage json
env-mage diff

$ env-mage stats

7

CLI commands

100%

Type-safe output

0

Dependencies

24/7

Open source

// Features

Everything your .env files need

A complete toolkit for environment variable management, built around a simple, predictable CLI.

$ env-mage intuitive-cli

Intuitive CLI

Simple, powerful commands that integrate seamlessly with your existing workflow.

$ env-mage template-management

Template Management

Create and manage .env.example templates with required and optional variable annotations.

$ env-mage typescript-integration

TypeScript Integration

Generate typed definitions so your config is checked at compile time, not at runtime.

$ env-mage variable-validation

Variable Validation

Validate values against templates to ensure everything required is present and correct.

$ env-mage sync-management

Sync Management

Keep .env files in sync with templates across environments and development stages.

$ env-mage codebase-scanning

Codebase Scanning

Scan your codebase to find every used variable and verify it is properly defined.

$ env-mage json-export

JSON Export

Convert .env files to JSON for frontend bundlers and container tooling.

// Use cases

Perfect for every project

From API keys to feature flags, EnvMage keeps every kind of configuration honest.

API Keys
Databases
Authentication
Endpoints
Integrations
Features
Cache
Logging
Files
Runtime

// Security

Security for your sensitive data

EnvMage is built with security best practices in mind. It helps you manage sensitive variables properly and prevents the most common environment-config mistakes.

env-mage scan --security

Scanning project…

Never commits .env files to version control

Separates sensitive data from template files

Validates environment variables for required values

Prevents leaking sensitive values in logs or error messages

✓ Security report generated — 0 issues found

// FAQ

Questions, answered

Take control of your environment

Install EnvMage, initialize a template, and let validation watch your back. You'll wonder how you managed without it.

$ npm install -g env-mage