Env-mage Docs

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

OptionDescriptionDefault
--from <path>Source file.env
--to <path>Destination file.env.example
--backupCreate backup before overwritingfalse

Example

env-mage init --from config/.env --to config/.env.example

Example Output

✓ Reading source file: .env
✓ Found 5 environment variables
✓ Creating template file: .env.example
✓ Template created successfully!

Things to Know

  • Creates .env.example files 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 --backup to avoid accidental overwrites