GitHub - mertdotdev/envdiff: Solve 'works on my machine' in 30 seconds - snapshot and diff dev environments · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
mertdotdev
envdiff
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>18 Commits<br>18 Commits
.github/workflows
.github/workflows
docs
docs
src
src
.gitignore
.gitignore
CHANGELOG.md
CHANGELOG.md
LICENSE
LICENSE
README.md
README.md
package-lock.json
package-lock.json
package.json
package.json
tsconfig.json
tsconfig.json
View all files
Repository files navigation
envdiff
Solve "works on my machine" in 30 seconds.
You know the drill: the code runs fine on your machine, your teammate pulls it — and it breaks. Same code, different computers. envdiff takes a snapshot of both environments, diffs them, and tells you the most likely culprit first: a missing tool, a different Node version, one env var. No more "what version do you have?" ping-pong.
Secrets are masked before anything touches disk, so snapshots are safe to send to a teammate.
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 of back-and-forth. envdiff finds it in seconds — and ranks the differences so the real suspect is at the top, not buried under noise.
Install
npx envdiffer snapshot -o mine.json
No install needed. (Or npm i -g envdiffer.)
Usage
# On your machine (where it works)<br>envdiff snapshot -o mine.json
# On the machine where it breaks (send them the one-liner)<br>npx envdiffer snapshot -o theirs.json
# Anywhere — compare<br>envdiff compare mine.json theirs.json
Output:
7 difference(s) — most suspicious first<br>left = merts-laptop, right = ci-runner
[tools]<br>~ node: v24.18.0 → v18.19.0<br>- docker (only left)<br>[system]<br>~ platform: win32 → linux<br>[env]<br>~ NODE_ENV: development → production<br>...
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-ci
Writes .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<br>envdiff compare mine.json ci-snapshot.json
What gets captured
Section<br>Contents
system<br>OS, arch, CPU count, RAM, shell, locale, timezone
tools<br>Versions of 24 common dev tools (node, python, go, docker, git, ...)
env<br>Environment variables — values matching secret patterns are masked
path<br>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
init-ci: snapshot your CI runner via GitHub Actions artifact
Custom tool probes via .envdiffrc
envdiff compare --json machine-readable output
License
MIT
About<br>Solve 'works on my machine' in 30 seconds - snapshot and diff dev environments<br>Topics<br>ci-cdclidebuggingdeveloper-toolsdevopsdevtoolsdotenvenvironment-variablesnodejsreproducibilitytypescript<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>0 stars<br>Watchers<br>0 watching<br>Forks<br>0 forks<br>Report repository
Releases
Packages
Contributors
Languages
You can’t perform that action at this time.