Configuration File

dotenv-diff supports a configuration file named dotenv-diff.config.json that allows you to persist your preferred flags. This makes it easier to share consistent settings between local development, teams, and CI/CD environments.

File Location

By default, dotenv-diff automatically looks for a dotenv-diff.config.json file in your project root (same folder as package.json).

You can quickly create one with the --init flag:

Terminal
dotenv-diff --init

Example Configuration

dotenv-diff.config.json
{
  "strict": false,
  "example": ".env.example",
  "ignore": [
    "NODE_ENV",
    "VITE_MODE"
  ],
  "ignoreUrls": [
    "https://example.com"
  ]
}

This configuration defines default behavior across comparisons, scanning, and output. Every field corresponds to an equivalent CLI flag — meaning you can use dotenv-diff entirely from configuration without passing command line options.

For a more detailed explanation and all options, see the configuration and flags documentation on GitHub.

Behavior Notes

  • All options are optional; dotenv-diff uses sensible defaults when omitted.
  • CLI flags always take precedence over configuration values.
  • The file must be valid JSON