{"id":50242914,"url":"https://github.com/Chrilleweb/dotenv-diff","last_synced_at":"2026-05-28T00:01:37.199Z","repository":{"id":304027881,"uuid":"1017600651","full_name":"Chrilleweb/dotenv-diff","owner":"Chrilleweb","description":"Validate environment variable usage in codebase","archived":false,"fork":false,"pushed_at":"2026-05-21T14:37:15.000Z","size":4952,"stargazers_count":49,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-21T23:41:27.055Z","etag":null,"topics":["cli","developer-tools","dotenv-cli","environment-variables","open-source","security","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dotenv-diff","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/Chrilleweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2025-07-10T19:41:13.000Z","updated_at":"2026-05-21T15:06:08.000Z","dependencies_parsed_at":"2025-07-10T23:58:56.132Z","dependency_job_id":"8278e8bc-57b9-40d0-953d-7abdfa9bc382","html_url":"https://github.com/Chrilleweb/dotenv-diff","commit_stats":null,"previous_names":["chrilleweb/dotenv-diff"],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/Chrilleweb/dotenv-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrilleweb%2Fdotenv-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrilleweb%2Fdotenv-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrilleweb%2Fdotenv-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrilleweb%2Fdotenv-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chrilleweb","download_url":"https://codeload.github.com/Chrilleweb/dotenv-diff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chrilleweb%2Fdotenv-diff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33588345,"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-05-27T02:00:06.184Z","response_time":53,"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","developer-tools","dotenv-cli","environment-variables","open-source","security","typescript"],"created_at":"2026-05-26T22:00:24.800Z","updated_at":"2026-05-28T00:01:37.193Z","avatar_url":"https://github.com/Chrilleweb.png","language":"TypeScript","funding_links":[],"categories":["Development"],"sub_categories":["Chat"],"readme":"# dotenv-diff\n\nScan your codebase to detect every environment variable reference. It helps you catch missing, unused, duplicated, and misused variables early, before they cause runtime errors.\n\nFirst-class support for SvelteKit and Next.js. Also works well in modern JavaScript/TypeScript projects and frameworks like Node.js, Nuxt, and Vue — or any other setup where you want reliable .env file comparison.\n\n[![Coverage Status](https://codecov.io/gh/Chrilleweb/dotenv-diff/branch/main/graph/badge.svg)](https://codecov.io/gh/Chrilleweb/dotenv-diff)\n[![npm version](https://img.shields.io/npm/v/dotenv-diff.svg)](https://www.npmjs.com/package/dotenv-diff)\n[![npm downloads](https://img.shields.io/npm/dt/dotenv-diff.svg)](https://www.npmjs.com/package/dotenv-diff)\n\n\u003e **✨ Featured in [awesome-cli-apps](https://github.com/agarrharr/awesome-cli-apps#development)** - A curated list of awesome CLI applications\n\n---\n\n### Warnings \u0026 errors detection\n\n![Demo](./docs/assets/demo.gif)\n\n### Clean / successful scan\n\n![Successful Scan](./docs/assets/success.png)\n\n---\n\n## Why dotenv-diff?\n\n- Ensure all required environment variables are defined before deploying\n- Catch missing or misconfigured variables early in development\n- Improve collaboration by keeping teams aligned on required variables\n- Reduce the risk of committing sensitive data\n- Scale easily for monorepos and multi-environment setups\n\n---\n\n## How It Works\n\n→ See [Capabilities Documentation](./docs/capabilities.md) for details on what the scanner checks for and how it works.\n\n---\n\n## Configuration (`--init`)\n\nGenerate a default configuration file:\n\n```bash\ndotenv-diff --init\n```\n\n→ See [Configuration Documentation](./docs/configuration_and_flags.md#configuration-file) for more details.\n\n---\n\n## Git hooks and CI/CD Integration\n\nEasily integrate dotenv-diff into your Git hooks or CI/CD pipelines to enforce environment variable consistency.\n\n→ See [Git Hooks Documentation](./docs/git_hooks_ci.md) for more details.\n\n## Framework-Specific Warnings\n\nIn SvelteKit and Next.js projects, dotenv-diff detects framework-specific\nenvironment variable misuses.\n\nExample warning:\n\n```bash\nFramework issues (Sveltekit):\n  - PUBLIC_API_URL (src/routes/+page.ts:1)\n    → $env/dynamic/private variables must not start with \"PUBLIC_\"\n```\n\n→ See [Framework Documentation](./docs/frameworks/index.md) for more details.\n\n## Ignore Comments\n\nYou can ignore specific environment variable warnings by adding comments in your code. For example:\n\n```javascript\nconst apiKey = process.env.API_KEY; // dotenv-diff-ignore\n```\n\nThis is helpful when you know a specific warning is safe in your source code.\n\n→ See [Ignore Comments Documentation](./docs/ignore_comments.md) for more details.\n\n---\n\n## Expiration Warnings\n\nAdd expiration metadata to your environment variables to get warnings when they are about to expire. For example, in your `.env` file:\n\n```bash\n# @expire 2025-12-31\nAPI_TOKEN=\n```\n\n→ See [Expiration Documentation](./docs/expiration_warnings.md) for more details.\n\n---\n\n## Explain a variable (`--explain`)\n\nInspect a specific environment variable to see where it is defined, where it is used in the codebase, and its overall status:\n\n```bash\ndotenv-diff --explain DATABASE_URL\n```\n\n→ See [--explain Documentation](./docs/configuration_and_flags.md#--explain-key) for more details.\n\n---\n\n## Monorepo support\n\nIn monorepos with multiple apps and packages, you can include shared folders:\n\n```json\n{\n  \"scripts\": {\n    \"dotenv-diff\": \"dotenv-diff --example .env.example --include-files '../../packages/**/*' --ignore VITE_MODE\"\n  }\n}\n```\n\n→ See [Monorepo Documentation](./docs/monorepo_support.md) for more details.\n\nThis will:\n\n- Scan the current app\n- Include shared packages\n- Ignore variables used only in specific environments\n\n---\n\n## Exit Codes\n\n- `0` → No errors\n- `1` → Errors found (or warnings in strict mode)\n\n---\n\n## Documentation\n\n→ See [dotenv-diff Documentation](./docs/index.md) for full documentation\n\n---\n\n## Contributing\n\nIssues and pull requests are welcome.  \n→ See [CONTRIBUTING](./CONTRIBUTING.md) for details.\n\nThanks to these amazing people for contributing to this project:\n\n\u003ca href=\"https://github.com/Chrilleweb/dotenv-diff/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Chrilleweb/dotenv-diff\" /\u003e\n\u003c/a\u003e\n\n---\n\n## License\n\nLicensed under the [MIT](LICENSE) license.\n\nCreated by [chrilleweb](https://github.com/chrilleweb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChrilleweb%2Fdotenv-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChrilleweb%2Fdotenv-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChrilleweb%2Fdotenv-diff/lists"}