Show HN: Env-rx – Catch missing .env variables before they break your CI
3 points| xserhio | 12 days ago |github.com
I built env-rx out of pure frustration with a painfully common problem. Someone on the team adds a new environment variable locally, forgets to share it or add it to the CI secrets, and the pipeline crashes right during deployment.
What makes it different: There are plenty of great secrets managers out there (like Doppler, Infisical, or Vault), but they often require team-wide buy-in, cloud syncing, and complex setups. I didn't want a heavy SaaS tool. I just wanted a lightweight, fast CLI utility that you can drop into any project, and it will loudly catch missing variables before you push or deploy.
It's designed to be zero-config. I’m releasing this open-source version first because I want to gather harsh, honest feedback from developers. I'd love to hear your thoughts on the DX or any edge cases I might have missed. If you manage to break it, please let me know!
xserhio|11 days ago
I think the main philosophical difference here is where the validation happens. If I understand correctly, varlock integrates directly into the application's config loading process. That’s incredibly powerful for runtime safety.
My goal with env-rx was to build something completely detached from the application runtime. I wanted a drop-in CLI utility that requires absolutely zero code changes or new dependencies in the actual app. You just throw it into a GitHub Action or a pre-commit hook, and it screams at you if a variable is missing before the code even builds.
But I really like your approach to having a unified schema instead of just comparing against an .example file. Definitely taking some notes from how varlock handles this!
theozero|11 days ago
You can just use `varlock run -- ...your command` and it will load, validate, and reinject as env vars. This is what enables it to be used with any language or any tool. We have a standalone binary. You could also just use `varlock load` to do validation and rely on values all being set externally. However we do provide javascript helpers to just load everything automatically - although this just calls out to the CLI, keeping your app isolated from the code that loads and validates the vars. For JS we actually go a bit further and patch http and console to protect any sensitive data - because we know exactly which config items are sensitive.
It's really meant to just be a complete complete toolkit and then let users integrate as deep as they want to.
theozero|12 days ago
You can use it to declaratively fetch from various backends, but it’s optional. At its core it lets you create a .env.schema and you get validation, type safety, guardrails for sensitive values, and a flexible toolkit to deal with all config related headaches.
The big difference from your tool (and many others) is that instead of trying to provide tooling to keep an example and other files in sync, the schema file is part of the loading process, so it can never be out of sync. This also helps create a single source of truth, and helps create a unified system to deal with all config - both sensitive and not.
unknown|11 days ago
[deleted]
unknown|12 days ago
[deleted]