Skip to content

zuhayrb/driftcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

driftcheck

driftcheck is a small CLI for comparing two .env-style files and reporting configuration drift.

It detects:

  • keys with different values
  • keys that exist only in the first file
  • keys that exist only in the second file

Usage

go run . <file1> <file2>

Example:

go run . file1.env file2.env

Sample output:

Difference for key 'DB_HOST': 'localhost' vs 'production.server.com'
Key 'API_KEY' exists in file 1 but not in file 2
Key 'NEW_FEATURE' exists in file 2 but not in file 1

If no drift is found, the command prints:

No differences found.

Exit Codes

  • 0: no differences found
  • 1: differences found, invalid arguments, or a file could not be read

Supported File Format

driftcheck currently supports simple .env lines in this form:

KEY=value

Blank lines and lines starting with # are ignored. Keys and values are trimmed for surrounding whitespace.

Build

go build -o driftcheck .

Then run:

./driftcheck file1.env file2.env

About

Detect .env drift before it breaks your deployment.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages