Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>EnvCompareNew to Visual Studio Code? Get it now.
EnvCompare

EnvCompare

Arjun Singh

| (0) | Free
Keep environment variable keys synchronized across all of your .env files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

EnvCompare

Keep all your .env files in sync, automatically.

EnvCompare compares environment-variable keys across the root-level env files in each VS Code workspace folder. It highlights missing keys without reading values into any external service.

Core features

  • Multi-file detection — Finds .env and every .env.* variant, including .env.local, .env.example, .env.production, and custom names such as .env.prod.
  • Cross-file comparison — Compares all detected files together and reports which keys are missing from each file.
  • Inline Tab-to-add suggestions — Shows missing keys as inline suggestions on an empty line. Press Tab to insert a snippet with editable values.
  • Real-time sync warnings — Watches env files with a short debounce and notifies you when a workspace changes between synced and out-of-sync states.
  • Create on demand — Scaffolds .env or .env.example without overwriting an existing file.
  • Multi-root workspaces — Compares and watches each workspace folder independently.
  • Local by design — Comparisons run against the local filesystem. EnvCompare does not transmit env keys or values.
  • Lightweight — Uses the VS Code API and Node.js standard library with no runtime dependencies.

Commands

Command Description
EnvCompare: Check Env Files Compare all env files and browse missing keys, source files, and target files.
EnvCompare: Create Env File Create and open a new .env or .env.example file.

Run either command from the Command Palette with Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows and Linux.

Using inline suggestions

  1. Open any .env or .env.* file.
  2. Place the cursor on an empty line.
  3. EnvCompare suggests keys that exist in another detected env file but are missing from the current file.
  4. Press Tab to accept the suggestion, then fill in each value.

EnvCompare compares variable names only. It does not copy secret values between files.

Why EnvCompare?

Teams can break local, staging, or production setups by adding a variable to one env file and forgetting the others. EnvCompare catches that mismatch while you work, before it becomes a deployment or onboarding problem.

Development

Requirements:

  • Node.js and npm
  • VS Code

Install dependencies and verify the project:

npm install
npm run compile
npm run lint
npm test

Press F5 in VS Code to compile the extension and open an Extension Development Host. Open a test workspace containing at least two env files with different keys, then run EnvCompare: Check Env Files.

Use npm run watch while developing to recompile TypeScript after changes.

How VS Code extensions work

VS Code extensions are Node.js programs that run in an Extension Host process, separate from the main editor UI. An extension declares commands and activation behavior in package.json, then uses the vscode API for editor features such as commands, notifications, file watchers, completions, and inline suggestions.

Extensions can be tested locally in an Extension Development Host and packaged for the Visual Studio Marketplace with Microsoft's vsce tooling.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft