Env-mage Docs

Diff

Compare env files

diff

Compares two environment files to show differences between them.

Usage

env-mage diff [options]

Options

OptionDescriptionDefault
--from <path>Source file.env
--to <path>Target file.env.example
--valuesInclude values in comparisonfalse (keys only)
--output <format>Output format: text, json, or tabletext

Example

env-mage diff --from .env.development --to .env.production --values

Example Output

✓ Reading source file: .env.development
✓ Reading target file: .env.production
⟡ Comparing files:

  Added keys (in target):
  + PRODUCTION_MODE
  + CDN_URL

  Removed keys (from source):
  - DEBUG
  - DEV_SERVER_PORT

  Changed values:
  ~ API_URL: "http://localhost:3000" → "https://api.example.com"
  ~ LOG_LEVEL: "debug" → "error"

✓ Summary: 2 added, 2 removed, 2 changed

Things to Know

  • Use to verify configuration changes between environments
  • Default mode only compares keys (use --values to compare values too)
  • Color-coded output helps spot differences quickly
  • Useful before deployments to ensure proper configuration