What is EnvDiff?

EnvDiff is a free, open-source command-line utility that compares two dotenv configuration files and shows where they differ, without displaying the configuration values.

Dotenv files are commonly used to store application settings. When working across development, staging and production environments, keeping those settings consistent can become difficult.

A missing setting might prevent an application from starting, while an unexpected difference could cause it to behave differently between environments.

EnvDiff helps identify these problems without requiring you to compare the files manually.

It was developed as the first project in the One Week Builds challenge and released on 20 November 2026.

See EnvDiff in action

The following example compares two configuration files, development.env and production.env.

Terminal comparison reports one missing key, one additional key and three changed keys without values.

EnvDiff comparing development and production configuration files, identifying differences without revealing their values.

The results identify:

  • One missing configuration key.
  • One additional key.
  • Three keys with different values.
  • No duplicate definitions.

The report shows the names of the affected keys but not their values.

This makes it possible to identify configuration differences without printing potentially sensitive settings in the terminal.

Features

EnvDiff provides several ways to inspect configuration differences.

Compare configuration values

The standard comparison checks whether keys exist in both files and whether their parsed values match.

It reports missing keys, additional keys, differing values and duplicate definitions.

Compare keys only

Sometimes you only need to know whether two configuration files contain the same settings, regardless of their values.

The --ignore-values option checks the configuration structure while ignoring value differences.

Terminal keys-only comparison reports missing and additional keys, with value differences ignored.

Keys-only mode checks configuration structure while ignoring differences between values.

In this example, EnvDiff still identifies the missing and additional keys, but the three value differences from the standard comparison are ignored.

Generate JSON reports

For scripts and automated workflows, EnvDiff can produce machine-readable JSON instead of its default text report.

Terminal JSON report lists missing, additional and changed configuration keys without values.

Machine-readable JSON output showing missing, additional and changed configuration keys.

The JSON output contains structured information about the differences, making it suitable for processing by other tools.

Use predictable exit codes

EnvDiff returns distinct exit codes for identical configurations, detected differences, errors and duplicate definitions.

This allows scripts and CI workflows to respond to the comparison results.

Download EnvDiff

EnvDiff v1.0.0 is available for:

  • Linux — amd64
  • Windows — amd64
  • macOS — arm64

Download the appropriate archive and checksum manifest from the EnvDiff v1.0.0 GitHub Release.

The GitHub repository contains installation instructions, command examples, technical documentation and source code.

EnvDiff is written in Go, uses only the Go standard library and is distributed under the MIT licence.

Testing and verification

EnvDiff v1.0.0 passed all 25 mandatory acceptance criteria.

Verification included local automated tests, three-platform GitHub Actions CI, release-candidate testing and a manual Linux smoke test.

The published Linux, Windows and macOS binaries were also downloaded and executed on their respective native platforms. Windows and macOS verification was automated rather than manual.

Important limitations

EnvDiff is designed to avoid displaying configuration values, but it is not an encryption or secret-management tool.

Configuration key names and comparison results can still reveal information. Values remain in process memory while files are processed.

EnvDiff supports a defined subset of dotenv syntax. It does not evaluate shell commands, perform variable interpolation or support physical multiline values.

Input files must be regular UTF-8 files of no more than 10 MiB each.

See the repository documentation for the complete supported syntax and security considerations.

Part of One Week Builds

EnvDiff was the first utility developed for One Week Builds, a project exploring what can be created with AI-assisted development in a short timeframe.

The accompanying Week 1 journal describes how the project progressed from an initial idea to a tested, publicly available release.

Related journal entries