WHAT IT DOES
Blank by default, because a commit is forever.
Paste a working .env and get the .env.example that belongs in the repository. Every value is emptied unless one of a short list of stated rules keeps it, and the values that survive are named back to you so the decision can be checked rather than trusted. Comments, blank lines, ordering, and the export prefix are preserved, because a .env.example is also the documentation for the file it describes.
Why use it?
A real .env is useful as a list of configuration keys but unsuitable as public documentation. This tool prepares an example while making retained values reviewable.
How to use this tool
- Paste or drop the source environment file locally.
- Run the sanitizer and review which values were kept or emptied by its fixed rules.
- Inspect comments and malformed lines separately before copying or saving the output; those lines are preserved and can still contain private information.
Details and limitations
- A value is kept only when a rule covers it: a boolean or an environment or log-level word, a number, or a URL that points at this machine and carries no user information. Everything else is emptied.
- A name that reads as a credential is emptied whatever its value looks like, so API_KEY=12345 does not survive on the grounds of being a number.
- postgres://localhost:5432/app is kept and postgres://user:pass@localhost:5432/app is not, because the second one carries the password that must not be committed.
- Names are matched as whole words rather than as substrings, so MONKEY_COUNT is not treated as a key and DESIGN_MODE is not treated as a signature.
- Comments, blank lines, indentation, quoting, the export prefix, and a trailing comment on an unquoted value all survive unchanged.
- A line that cannot be read as an assignment is copied through untouched and counted in the summary rather than dropped.