Init
Create env templates
init
Creates a template file from your existing .env file by keeping the keys but removing the values.
Usage
env-mage init [options]Options
| Option | Description | Default |
|---|---|---|
--from <path> | Source file | .env |
--to <path> | Destination file | .env.example |
--backup | Create backup before overwriting | false |
Example
env-mage init --from config/.env --to config/.env.exampleExample Output
✓ Reading source file: .env
✓ Found 5 environment variables
✓ Creating template file: .env.example
✓ Template created successfully!Things to Know
- Creates
.env.examplefiles that can be safely committed to version control - Preserves comments and formatting from source file
- Empty values in template make it clear which variables are needed
- Use with
--backupto avoid accidental overwrites