Repository navigation
CLI Guide
Installing env-saaf gives you the env-saaf command.
Creates a starter env.schema.js (with commented examples of the main types) and a matching .env.example. It refuses to overwrite existing files unless you pass --force. Use --schema <name> for a different schema file name.
Compares the variables your code actually uses against .env.example (and your real .env when one exists). It reports missing, extra and unused keys. Any finding exits with code 1, so it can fail a CI job.
Add --schema <file> to also validate the real .env values against your schema.
Scans a directory of source code for process.env usage and prints what it finds. When nothing is found, it says so on stderr instead of printing nothing.
Generates a .env.example from your code scan or from a schema. With --write it writes the file — and if there is nothing to write, it warns and writes no file.
| Flag | Meaning |
|---|---|
--json |
Machine-readable output |
--no-color |
Disable coloured output |
--help |
Help for the command (also works after a subcommand) |
--version |
Print the installed version |
- run: npm ci
- run: npx env-saaf checkA non-zero exit code fails the job, so a drifting .env.example is caught in review instead of in production.
env-saaf Wiki
Español
- Home-es
- Getting-Started-es
- CLI-Guide-es
- Types-Reference-es
- FAQ-and-Troubleshooting-es
- Contributing-Guide-es
Português
- Home-pt-br
- Getting-Started-pt-br
- CLI-Guide-pt-br
- Types-Reference-pt-br
- FAQ-and-Troubleshooting-pt-br
- Contributing-Guide-pt-br
हिंदी
- Home-hi
- Getting-Started-hi
- CLI-Guide-hi
- Types-Reference-hi
- FAQ-and-Troubleshooting-hi
- Contributing-Guide-hi
简体中文
- Home-zh-cn
- Getting-Started-zh-cn
- CLI-Guide-zh-cn
- Types-Reference-zh-cn
- FAQ-and-Troubleshooting-zh-cn
- Contributing-Guide-zh-cn