Env Sync Checker — Compare & Sync .env Files
Stop deploying with missing environment variables.
Compare all your .env files instantly. Find missing keys before they break your app. Auto-generate .env.example from your existing configuration.
The Problem
You add STRIPE_SECRET_KEY to .env.local. You forget to add it to .env.example. Your teammate pulls the repo, copies .env.example to .env, and spends 30 minutes debugging why Stripe calls fail.
This happens on every team, on every project, every week.
The Solution
Env Sync Checker continuously compares your .env files and tells you exactly which keys are missing, which files are out of sync, and what needs to be fixed — with one-click quick fixes to resolve everything instantly.
Zero configuration required. Install it. It works.
Features
Missing Key Detection
Env Sync Checker scans every .env* file in your workspace and compares them against your .env.example (or whichever file has the most keys). Missing keys appear as yellow warning squiggles directly in your editor, in the Problems panel, and in the File Explorer as warning badges.
One-Click Quick Fixes
Click the lightbulb on any missing key warning and choose:
- Add KEY_NAME to this file — inserts the key at the correct position
- Add KEY_NAME with value from reference — copies the actual value
- Add all missing keys — bulk-inserts every missing key at once
For extra keys (keys in your file but not in the reference), you can:
- Add KEY_NAME to .env.example — with an auto-generated placeholder
- Remove KEY_NAME — deletes the line
The Activity Bar shows a dedicated Sync Status panel with a tree view of all your environment variables, grouped by prefix (Database, API, Authentication, etc.). Each key shows its status across all files at a glance:
- ✅ Present with a value
- ⚠️ Empty or placeholder value
- ❌ Missing from this file
Click any key to jump directly to that line in the file. The Activity Bar badge shows the total count of missing keys across your project.
Status Bar Indicator
A persistent status bar item shows your sync status at a glance:
- $(check) Env: Synced — all files have all keys
- $(warning) Env: 3 missing — quick visual alert when files drift
Click it to open the Sync Status sidebar.
Auto-Generate .env.example
Run Env Sync: Generate .env.example from the Command Palette or right-click a scope in the sidebar. The extension:
- Reads your
.env file (or the file with the most keys)
- Preserves all comments and blank lines for structure
- Replaces actual values with smart placeholders:
STRIPE_SECRET_KEY → your_secret_here
DATABASE_URL → https://example.com
PORT → 3000
ADMIN_EMAIL → you@example.com
- If
.env.example already exists, opens a diff view so you can review changes
Monorepo Support
In monorepos, .env files in different packages are compared independently. packages/api/.env is never compared against packages/web/.env — they're separate scopes with separate references. The sidebar groups them automatically.
New Missing Keys Notification
After a git pull or when a teammate adds new keys, you'll see a notification:
2 new missing keys: REDIS_URL, QUEUE_SECRET [Add All]
Click Add All to insert every missing key into your .env file in one step.
Why Not DotENV?
DotENV provides syntax highlighting for .env files — colored keys and values. It's great at that.
Env Sync Checker does something completely different: it compares your .env files and finds missing keys. No syntax highlighting. No overlap.
Use both together. DotENV makes your .env files look nice. Env Sync Checker makes sure they're correct.
Installation
From the Marketplace
- Open VS Code
- Press
Ctrl+Shift+X (or Cmd+Shift+X on Mac)
- Search for "Env Sync Checker"
- Click Install
From the Command Line
code --install-extension shipkit.env-sync-checker
Manual Install
Download the .vsix file from GitHub Releases and run:
code --install-extension env-sync-checker-1.0.0.vsix
Commands
All commands are available from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command |
Description |
Env Sync: Open Comparison |
Reveal the Sync Status sidebar |
Env Sync: Generate .env.example |
Generate or update .env.example from your .env file |
Env Sync: Refresh |
Manually re-scan all .env files |
Env Sync: Copy All Keys |
Copy all unique key names to clipboard |
Env Sync: Copy Missing Keys |
Copy missing keys for a specific file to clipboard |
Env Sync: Change Reference File |
Override which file is used as the comparison reference |
Configuration
All settings are optional. The extension works with zero configuration.
| Setting |
Type |
Default |
Description |
envSync.referenceFile |
string |
"" (auto) |
Override the reference file for comparison. Leave empty to auto-detect (prefers .env.example, then the file with the most keys). Applied per-scope in monorepos. |
envSync.ignoredKeys |
string[] |
[] |
Key names or glob patterns to ignore (e.g., ["LOCAL_*", "DEBUG"]). |
envSync.ignoredFiles |
string[] |
[] |
File basename patterns to exclude (e.g., [".env.test", ".env.ci"]). |
envSync.scanDepth |
integer |
2 |
How many subdirectory levels to scan (0 = root only). |
envSync.showValuesInTooltips |
boolean |
false |
Show actual values in sidebar tooltips. Disabled by default for security. |
envSync.placeholderPatterns |
object |
{} |
Custom placeholder rules for .env.example generation (e.g., {"MONGO": "mongodb://localhost:27017/mydb"}). |
envSync.autoRefresh |
boolean |
true |
Automatically refresh when .env files change. |
How It Works
Discovery — On activation, the extension finds every .env* file in your workspace (up to scanDepth levels deep) and groups them by directory into independent scopes.
Parsing — Each file is parsed with a custom parser that handles export prefixes, multi-line quoted values, comments, and blank lines.
Comparison — Within each scope, every key is compared across all files. The reference file (.env.example by default) determines which keys should exist.
Diagnostics — Missing keys produce Warning diagnostics with quick fixes. Extra keys produce Information diagnostics.
Live Updates — A file watcher monitors all .env* files and re-runs the comparison automatically (debounced to 500ms).
Requirements
- VS Code 1.74.0 or later
- No additional dependencies
- Zero runtime dependencies — everything is built in
- <25KB bundled — loads instantly, no bloat
- <10ms comparison time — for typical projects (5-10 files, 20-100 keys)
- No network calls — everything runs locally
- No telemetry — your data stays on your machine
FAQ
Q: Does this work with .env.local, .env.production, .env.staging, etc.?
A: Yes. Any file matching .env* is automatically discovered and compared.
Q: What if I have .env files in subdirectories (monorepo)?
A: Files are grouped by parent directory and compared independently. packages/api/.env and packages/web/.env are never compared against each other.
Q: Can I exclude certain files from comparison?
A: Yes. Use envSync.ignoredFiles to exclude files by basename pattern (e.g., [".env.test"]).
Q: Can I exclude certain keys from comparison?
A: Yes. Use envSync.ignoredKeys with exact names or glob patterns (e.g., ["LOCAL_*", "DEBUG"]).
Q: Does this extension read my secret values?
A: The extension reads file contents locally to compare keys. Values are never transmitted anywhere. By default, values are hidden in tooltips — you can enable envSync.showValuesInTooltips if you want to see them.
Q: How does .env.example generation handle sensitive values?
A: All values are replaced with descriptive placeholders. Keys containing SECRET, PASSWORD, TOKEN, or KEY get your_secret_here. URLs get https://example.com. Ports get 3000. You can customize this with envSync.placeholderPatterns.
Contributing
Found a bug? Have a feature request? Open an issue on GitHub.
License
MIT
More from ShipKit — We build developer tools that save you time. Check out our other extensions on the VS Code Marketplace.