{"id":51294832,"url":"https://github.com/lorenzopant/envdrift","last_synced_at":"2026-06-30T13:32:19.500Z","repository":{"id":363087621,"uuid":"1261917856","full_name":"lorenzopant/envdrift","owner":"lorenzopant","description":"CLI that finds keys missing or extra across your .env files — catch config drift between local, staging, and production before it breaks a deploy.","archived":false,"fork":false,"pushed_at":"2026-06-07T10:53:14.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T12:19:29.774Z","etag":null,"topics":["cli","diff","drift","drift-detection","drift-monitoring","env","env-dev","env-drift","environment-variables"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lorenzopant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T10:30:19.000Z","updated_at":"2026-06-07T10:53:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lorenzopant/envdrift","commit_stats":null,"previous_names":["lorenzopant/envdrift"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lorenzopant/envdrift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorenzopant%2Fenvdrift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorenzopant%2Fenvdrift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorenzopant%2Fenvdrift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorenzopant%2Fenvdrift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lorenzopant","download_url":"https://codeload.github.com/lorenzopant/envdrift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorenzopant%2Fenvdrift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34969682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","diff","drift","drift-detection","drift-monitoring","env","env-dev","env-drift","environment-variables"],"created_at":"2026-06-30T13:32:19.249Z","updated_at":"2026-06-30T13:32:19.462Z","avatar_url":"https://github.com/lorenzopant.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envdrift 🌱⚡\n\nCLI that detects drift between `.env*` files in a project — catches the case\nwhere a variable is set in `.env.local` but missing from `.env.production`\n(or vice versa) before it causes a runtime surprise.\n\nIt compares **keys only**, never values — no secrets are read into memory or\nprinted. 🔒\n\n## 📦 Install / run\n\nPublished as a scoped package — install globally and run as `envdrift`:\n\n```bash\nnpm install -g @lorenzopant/envdrift\nenvdrift [dir]\n```\n\nOr run it ad-hoc without installing:\n\n```bash\nnpx @lorenzopant/envdrift [dir]\n```\n\n### From source\n\n```bash\npnpm install\npnpm run build\nnode dist/index.js [dir]\n```\n\nOr during development, skip the build step:\n\n```bash\npnpm dev [dir]\n```\n\n`[dir]` defaults to the current directory.\n\n## 🚀 Usage\n\n```bash\nenvdrift [dir] [options]\n```\n\n| Option | Description |\n| --- | --- |\n| `--depth \u003cn\u003e` | max directory depth to scan (default: `5`) |\n| `--autofix` | append missing keys (empty value) to files where they're absent, marked with a `# --- added by envdrift --autofix ---` comment |\n| `--md [path]` | write a Markdown drift report to `\u003cpath\u003e` (default: `envdrift-report.md`) |\n| `--fail-on-drift` | exit with code `1` when drift is found (CI/CD gate) |\n\n### Example\n\n```\n$ envdrift .\n\nScanned 3 env file(s):\n  - .env (4 keys)\n  - .env.local (4 keys)\n  - .env.production (7 keys)\n\nDrift found in 3 key(s):\n\nLegend:\n  F1 = .env\n  F2 = .env.local\n  F3 = .env.production\n\n                F1  F2  F3\n  ------------  --  --  --\n  GITHUB_TOKEN  ✗   ✓   ✗\n  RATE_LIMIT_MAX ✗  ✗   ✓\n  SENTRY_DSN    ✗   ✗   ✓\n```\n\nBy default, exit code is always `0` — envdrift reports drift without failing\nyour build. Pass `--fail-on-drift` to exit with code `1` when drift is found,\nturning it into a CI/CD gate:\n\n```bash\nenvdrift . --fail-on-drift\n```\n\nUse `--md` to produce a file you can attach to CI artifacts or PRs if you want\ndrift to be visible in review regardless of whether the build fails.\n\n## ⚙️ How it works\n\n1. **Scan** — recursively find `.env*` files (skips `node_modules`, `.git`,\n   build output dirs).\n2. **Parse** — read each file's keys via `dotenv` (values discarded).\n3. **Diff** — build a presence matrix across all files; any key not present\n   in every file counts as drift.\n4. **Report** — render as a terminal matrix, optionally a Markdown file, and\n   optionally autofix by appending missing keys with empty values.\n\n## 🗂️ Project layout\n\n```\nsrc/\n  scanner.ts   find .env* files on disk\n  parser.ts    parse a file into its set of keys\n  diff.ts      build the drift report (presence matrix)\n  report.ts    render the report (terminal matrix, Markdown)\n  autofix.ts   append missing keys to files\n  index.ts     CLI entry point (commander)\n```\n\n## 🤝 Contributing\n\nContributions welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for setup,\ndev workflow, and conventions. Please follow our\n[Code of Conduct](CODE_OF_CONDUCT.md).\n\n## 📄 License\n\n[MIT](LICENSE) © Lorenzo Pantano\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florenzopant%2Fenvdrift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florenzopant%2Fenvdrift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florenzopant%2Fenvdrift/lists"}