envdiffer
v0.1.0
Published
Solve "works on my machine" — snapshot and diff dev environments across machines.
Maintainers
Readme
envdiff
Solve "works on my machine" in 30 seconds.
Snapshot a dev environment on two machines, diff them, and see the differences ranked by how likely they are to be the culprit — tool versions first, env noise last. Secrets are masked before anything touches disk.
Why
"Works on my machine" is never magic. It's a different Node version, a missing tool on PATH, or one env var. Finding which one by hand takes an hour. envdiff finds it in seconds.
Install
npx envdiff-cli snapshot -o mine.jsonNo install needed. (Or npm i -g envdiff-cli.)
Usage
# On your machine (where it works)
envdiff snapshot -o mine.json
# On the machine where it breaks (send them the one-liner)
npx envdiff-cli snapshot -o theirs.json
# Anywhere — compare
envdiff compare mine.json theirs.jsonOutput:
7 difference(s) — most suspicious first
left = merts-laptop, right = ci-runner
[tools]
~ node: v24.18.0 → v18.19.0
- docker (only left)
[system]
~ platform: win32 → linux
[env]
~ NODE_ENV: development → production
...Exit code is 1 when differences exist (diff convention), so it drops into scripts and CI.
"Why does it only break in CI?"
envdiff init-ciWrites .github/workflows/envdiff.yml — every CI run uploads a snapshot of the runner's environment as an artifact. Download it and diff against your machine:
gh run download -n envdiff-snapshot
envdiff compare mine.json ci-snapshot.jsonWhat gets captured
| Section | Contents | |---|---| | system | OS, arch, CPU count, RAM, shell, locale, timezone | | tools | Versions of 24 common dev tools (node, python, go, docker, git, ...) | | env | Environment variables — values matching secret patterns are masked | | path | Deduplicated PATH entries |
Security
Env values are masked by name pattern (*KEY*, *TOKEN*, *SECRET*, ...) and by value shape (long high-entropy strings), before the snapshot is written. Review the JSON before sharing anyway — it's your environment.
Roadmap
- [x]
init-ci: snapshot your CI runner via GitHub Actions artifact - [ ] Custom tool probes via
.envdiffrc - [x]
envdiff compare --jsonmachine-readable output
License
MIT
