I built a CLI tool to stop .env file chaos across environments

Published: (February 18, 2026 at 10:49 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

The Problem

Every team I’ve worked with has had the same issue: someone adds a new environment variable, forgets to inform the rest of the team, and suddenly staging breaks because a required variable like DATABASE_URL is missing.

Introducing env‑doctor

env‑doctor is a zero‑dependency CLI tool that helps keep .env files consistent across environments.

Features

  • check – Validates your .env against a .env.example or a schema file, detecting missing variables, type mismatches, and bad formats.
  • diff – Compares two .env files side‑by‑side, highlighting missing, extra, or changed entries.
  • mask – Outputs your .env with values hidden, safe for sharing in Slack or pull‑request comments.
  • init – Generates a .env.example automatically from an existing .env file.

It also supports a .env.schema format where you can define types, patterns, required fields, enums, and min/max constraints, allowing validation to catch real issues before deployment.

Installation & Usage

npx @atyahassis/env-doctor check

The tool works with Node 18+ and has no external dependencies.

License

MIT licensed.

Repository

github.com/AtyahsLab/env-doctor

0 views
Back to Blog

Related posts

Read more »

lazygit-style TUI for NuGet

!Cover image for lazygit-style TUI for NuGethttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-up...