← All tools

umuttopalak/driftcheck

Popularity 65 Updated DevOps & Cloud

Detect config and environment variable drift across .env files, Docker, Compose and Kubernetes

githubauto-collected

Installation

A directly usable install command is not verified yet. Check the project documentation or releases.

driftcheck

A CLI that finds config / environment variable drift between environments. It compares local .env files, running Docker containers, docker-compose services and Kubernetes ConfigMaps/Secrets side by side.

$ driftcheck compare --source dev=local:.env.dev --source prod=k8s:production/app-config
╭──────────────────────┬─────────────┬───────────┬──────────────────╮
│ KEY                  │ STATUS      │ dev       │ prod             │
├──────────────────────┼─────────────┼───────────┼──────────────────┤
│ DATABASE_TIMEOUT     │ ≠ different │ 30        │ 60               │
│ FEATURE_NEW_CHECKOUT │ ✗ missing   │ true      │ ✗ missing        │
│ LOG_LEVEL            │ ≠ different │ debug     │ warn             │
╰──────────────────────┴─────────────┴───────────┴──────────────────╯
2 different, 1 missing, 5 same (hidden, use --show-all)

Installation

Prebuilt binaries: download the archive for your platform from the Releases page and put driftcheck on your PATH. One-liner for Linux / macOS:

OS=$(uname -s | tr A-Z a-z); ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
VERSION=$(curl -s https://api.github.com/repos/umuttopalak/driftcheck/releases/latest | grep -o '"tag_name": *"v[^"]*' | grep -o 'v.*')
curl -sL "https://github.com/umuttopalak/driftcheck/releases/download/${VERSION}/driftcheck_${VERSION#v}_${OS}_${ARCH}.tar.gz" | tar -xz driftcheck
sudo mv driftcheck /usr/local/bin/

With Go:

go install github.com/umuttopalak/driftcheck/cmd/driftcheck@latest

From source:

git clone https://github.com/umuttopalak/driftcheck
cd driftcheck
make build          # bin/driftcheck

Building from source requires Go 1.22+. On macOS use make build instead of go build; see NOTES.md for why.

Usage

Each source is given as [name=]type:target:

driftcheck compare \
  --source dev=local:.env.dev \
  --source staging=k8s:staging/app-config \
  --source container=docker:api-1

You can pass more than two sources; the table gets one column per source.

Source types

driftcheck adapters prints this list.

| Type | Target | Example | |---|---|---| | local (file) | path[,path...] or shell | local:.env.dev, local:base.env,override.env, local:shell | | docker (container) | container name or ID | docker:api-1 | | compose (docker-compose) | [file][@service] | compose:docker-compose.yml@api | | kubernetes (k8s) | [context@]namespace[/name \| /kind/name[/container]] | k8s:staging, k8s:staging/app-config, k8s:prod@staging/secret/app-secrets, k8s:staging/deployment/api/web |