Why Features Docs GitHub
Open Source CLI Tool

Validate your
.env files
before you ship

A lightweight, zero-config CLI that catches missing variables, empty values, and configuration drift. Stop environment issues from breaking production.

$ npm install -g envsane
Works with Node.js 16+
terminal
$ envsane check
Checking .env against .env.example
Missing variables:
• DATABASE_URL
• API_SECRET
Empty values:
• REDIS_URL
Found 2 errors and 1 warning
3 Powerful Commands
0 Config Required
6 Issue Types Detected
100% Offline & Private

Environment variables are a silent killer

They seem simple until they break production at 2am. Here's what typically goes wrong:

Missing Variables

Someone adds NEW_API_KEY to production but forgets to update the example file. New developers onboard without it.

Empty Values

The key exists, but the value is blank. Your app starts fine, then mysteriously fails when it tries to connect to the database or external service.

Case Mismatches

DB_URL vs db_url

Duplicate Keys

Same variable twice. Last wins.

Configuration Drift

Production has 47 variables, staging has 42, development has 38. Which ones are actually needed? Good luck figuring that out without proper tooling.

No Documentation

What does FEATURE_FLAG_XYZ do? What's a valid value? Open the code and hope someone left a comment.

Three commands. Zero configuration.

envsane does exactly what you need and nothing more. No accounts, no dashboards, no complexity.

check Primary

Validate your environment

Compare your .env file against .env.example to catch issues before they become problems. The command treats your example file as the source of truth and reports any deviations.

  • Missing variables from example
  • Empty or blank values
  • Extra undocumented variables
  • Case sensitivity issues
  • Duplicate key definitions
  • Whitespace problems
$ envsane check
All variables are correctly defined
Found 0 errors and 0 warnings
diff

Compare any two files

See exactly what's different between any two environment files. Perfect for debugging why staging works but production doesn't, or ensuring parity across environments.

  • Variables only in file A
  • Variables only in file B
  • Value differences (opt-in)
  • Sensitive value masking
$ envsane diff .env.prod .env.staging
Comparing .env.prod and .env.staging
→ Only in .env.prod:
- SENTRY_DSN
- ANALYTICS_KEY
→ Only in .env.staging:
+ DEBUG_MODE
explain

Understand your variables

Get instant documentation for any environment variable. envsane reads comments from your .env.example file and displays them in a clean, readable format with type inference.

  • Comment extraction
  • Automatic type inference
  • Example values
$ envsane explain DB_POOL_SIZE
DB_POOL_SIZE
Purpose: Maximum number of database
connections allowed
Expected type: integer
Example: 10

Up and running in seconds

No configuration files. No setup wizards. Just install and run.

1

Install globally via npm

npm install -g envsane

Or use npx: npx envsane check

2

Navigate to your project

cd your-project

Make sure you have a .env.example file

3

Run the validation

envsane check

Exit code 0 = success, 1 = issues found

Command Options

--strict Treat warnings as errors (exit code 1)
--json Output results as JSON for scripting
--no-color Disable colored output for CI logs
-e, --env <file> Custom .env file path
-x, --example <file> Custom .env.example file path
-v, --values Show value differences in diff

Fits into any workflow

CI/CD Pipelines

Add to your build process to catch missing variables before deployment reaches production.

envsane check --strict

Team Onboarding

New developers can instantly validate their local setup matches project requirements.

envsane check

Environment Audits

Compare production vs staging vs dev to understand configuration differences.

envsane diff .env.prod .env.staging

Documentation Lookup

Quickly understand what a variable does without digging through codebases.

envsane explain API_KEY

Ready for fewer broken deploys?

Install envsane and start validating your environment files today. It takes 30 seconds.

$ npm install -g envsane