envm

GitHub

A CLI tool for managing .env files. Compare environments with set operations, merge with conflict strategies, snapshot state, validate against schemas, and more.

If you've ever had to figure out why staging works but production doesn't, and ended up manually diffing .env files in two terminal panes — that's the problem.

Install

1curl -fsSL https://raw.githubusercontent.com/Saadkhalid913/envm/main/install.sh | bash

What it does

  • diff — color-coded side-by-side comparison across any number of env files, with set operation filters (union, intersection, xor, diff)
  • merge — merge multiple env files with configurable conflict strategies
  • snapshot — save and restore named snapshots of env state before risky changes
  • validate — validate env files against JSON schemas, useful as a CI gate
  • clone — duplicate an env file with inline overrides and key removal
  • template — generate a .env.example that strips sensitive values
  • schema generate — infer a validation schema from existing env files with automatic type detection

Example: comparing all env files at once

1envm diff .env.* # glob — compare all env files
2envm diff .env.staging .env.production --only diff # only show differences

Values that match across files are shown in the same color per row, so you can instantly see which environments diverge.