npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

env-clinic

v1.3.0

Published

Zero-config CLI to find missing, extra, and empty variables in your .env file

Downloads

165

Readme


Why env-clinic?

You clone a repo. You run npm install. You run npm start. It crashes.

Three environment variables are missing from your .env file but present in .env.example. You spend five minutes debugging a silent failure that should have been obvious.

env-clinic catches this in one second. It's a zero-config CLI that diffs your environment files instantly, so you can stop guessing and start coding.


🚀 Usage

No install required. Just run it in your project root:

npx env-clinic

It automatically finds your .env and looks for an .env.example (or .sample, .template) to compare against.

Requires Node.js 20 or newer.

Empty values like EMPTY= are reported separately. Use --strict if you want those to fail the check.


✨ Output Example

env-clinic checks your .env for completeness and gives you a clear report:

  ✅ DATABASE_URL        — present
  ❌ STRIPE_SECRET_KEY   — MISSING (in example but not in .env)
  ⚠️  OLD_REDIS_URL      — EXTRA (in .env but not in example)
  ⚠️  DEBUG_MODE         — EMPTY (present but has no value)

  💡 Tip: run with --fix to fill these in interactively.

🪄 Auto-Prompt (v1.2.0+)

You don't even need to remember the flags. In an interactive terminal, env-clinic will automatically ask if you want to fix or prune variables on the spot:

❓ Would you like to fill in missing variables now? [y/N]

🛠️ Manual Mode

You can also trigger flags manually:

npx env-clinic --fix

It will prompt you for each missing variable and append it to your .env file safely. If the variable has a default value in your example file, it will be shown as a suggestion — press Enter to accept it.


⚙️ Options

| Flag | Description | Example | |------|-------------|---------| | --fix | Interactive mode to fill in missing variables. Shows example defaults as suggestions. | npx env-clinic --fix | | --prune | Interactive mode to remove EXTRA variables from your .env. | npx env-clinic --prune | | --ci | Plain text output for CI/CD pipelines (no colors/emojis). | npx env-clinic --ci | | --strict | Treats empty variables as errors (exits 1). | npx env-clinic --strict | | --quiet | Only shows errors and warnings. | npx env-clinic --quiet | | --file | Custom path to your .env file. | npx env-clinic --file .env.prod | | --example | Custom path to your reference file. | npx env-clinic --example .env.sample | | --json | Output results as JSON for automation. | npx env-clinic --json | | --version | Show the version number. | npx env-clinic --version | | --help | Show help information. | npx env-clinic --help |


🛡️ CI/CD

Stop broken deployments. Add this to your CI workflow (e.g., GitHub Actions) to ensure all required secrets are present:

- name: Check environment variables
  run: npx env-clinic --ci

env-clinic exits with 0 on match and 1 if anything is missing.


🔒 Security

env-clinic reads only the KEYS from your .env file. It never reads, prints, logs, or transmits your actual secret values. Your secrets stay on your machine.


🤝 Contributing

This is a tiny, focused tool built to solve one specific pain point. If you have a bug fix or a small improvement, feel free to open a PR!


MIT License © 2026 ChloeVPin