Commands
env-mage commands
Commands
env-mage provides these core commands for managing environment variables:
| Command | Purpose | Common Use |
|---|---|---|
init | Create template files | Project setup, standardizing variables |
validate | Check required variables | Before deployment, CI/CD pipelines |
sync | Sync between files | Keeping environments in sync |
diff | Compare files | Troubleshooting, environment review |
typegen | Generate types | TypeScript projects, type safety |
scan | Find code usage | Code audits, unused variable detection |
lint | Check formatting | Enforcing standards, fixing syntax |
json | Generate JSON | Front-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 --helpCommon Workflows
Project Setup
# Initialize from existing .env
env-mage init
# Validate configuration
env-mage validateBefore Deployment
# Check for required variables
env-mage validate --strict
# Verify correct formatting
env-mage lintMaintaining Template
# Update template after code changes
env-mage scan --compare .env
env-mage sync --source .env --target .env.example