cwhite92/dotenvdiff

Easily see differences between two .env files

v1.0.0 2020-10-30 01:56 UTC

This package is auto-updated.

Last update: 2024-10-29 05:47:48 UTC


README

dotenvdiff

dotenvdiff (ded) allows you to quickly compare the environment variable differences between two .env (or .env.example) files.

Installation

Requirements:

  • PHP 7.3 or greater

Require the tool globally via Composer:

composer global require cwhite92/dotenvdiff

If you don't have Composer's bin directory in your $PATH, now is the time to add it to ~/.bash_profile or ~/.bashrc:

export PATH=~/.composer/vendor/bin:$PATH

Usage

Simply run the ded command and give it the locations of the two .env files that you wish to compare:

ded /path/to/first/.env /path/to/second/.env

If you're running this in a Laravel project, you probably want to run it like this in your project's root directory:

ded .env.example .env

It will give an output similar to the below:

╔═════════════════════╤══════╗
║ .env.example        │ .env ║
╟─────────────────────┼──────╢
║ GITHUB_API_ENDPOINT │      ║
╚═════════════════════╧══════╝

In this instance, there is a new GITHUB_API_ENDPOINT environment variable that exists in .env.example but not in .env. Somebody on our team added it and forgot to tell us 🙂

License

cwhite92/dotenvdiff is licensed under the MIT License (MIT). Please see the license file for more information.