Env-mage Docs

Commands

env-mage commands

Commands

env-mage provides these core commands for managing environment variables:

CommandPurposeCommon Use
initCreate template filesProject setup, standardizing variables
validateCheck required variablesBefore deployment, CI/CD pipelines
syncSync between filesKeeping environments in sync
diffCompare filesTroubleshooting, environment review
typegenGenerate typesTypeScript projects, type safety
scanFind code usageCode audits, unused variable detection
lintCheck formattingEnforcing standards, fixing syntax
jsonGenerate JSONFront-end integration, documentation

Basic Usage

All commands follow this pattern:

env-mage <command> [options]

Getting Help

For any command, use the --help flag to see options:

env-mage init --help
env-mage validate --help

Common Workflows

Project Setup

# Initialize from existing .env
env-mage init

# Validate configuration
env-mage validate

Before Deployment

# Check for required variables
env-mage validate --strict

# Verify correct formatting
env-mage lint

Maintaining Template

# Update template after code changes
env-mage scan --compare .env
env-mage sync --source .env --target .env.example