Switch between dev, staging, and prod
.envprofiles in one click. Secrets live in the OS keychain — never as plaintext files in your repo.
You're juggling .env.dev, .env.staging, .env.prod sitting inside your project.
One accidental git add . and your API keys are in the commit history — forever.
EnvSwitch removes those files from the equation. Every secret is stored in your OS keychain (macOS Keychain, Windows Credential Manager, Linux libsecret). Nothing sensitive ever touches disk.
| EnvSwitch | File-based switchers | |
|---|---|---|
| Secrets stored in OS keychain | ✅ | ❌ plaintext on disk |
Validation against .env.example |
✅ | ❌ |
| Search a variable across all profiles | ✅ | ❌ |
| Side-by-side profile diff | ✅ | ❌ |
| Snapshot history + one-click restore | ✅ | ❌ |
| One-click switching | ✅ | ✅ |
| Works without extra config files in the repo | ✅ | ❌ |
- Multiple profiles per workspace — dev, staging, prod, or any name you want
- One-click activation from the sidebar, status bar, or Command Palette
- Validation vs
.env.example— instantly see missing, empty, and extra keys - Variable search across all profiles with masked values by default
- Side-by-side diff between any two profiles
- Snapshot history — every activation saves a restore point (last 5 snapshots)
- Import from an existing
.envfile when creating a profile - Auto-sync — edits to the active
.envfile on disk are automatically picked up
- Click the EnvSwitch icon in the Activity Bar (left sidebar).
- Press + to create your first profile.
- Give it a name (
dev,prod, etc.) and confirm the target file (.env). - Choose to import your current
.envor start empty. - Click the profile to activate it — done.
Switch anytime via the ENV button in the status bar or Ctrl+Shift+P → EnvSwitch: Switch Profile.
Right-click any profile → Validate vs .env.example.
| Result | Meaning |
|---|---|
| Missing | Required by .env.example but absent from this profile |
| Empty | Key exists but has no value |
| Extra | Present in profile but not in .env.example |
Click the 🔍 icon in the EnvSwitch view header, or run EnvSwitch: Search Variable.
- Pick a key to see its value in every profile at once
- Values are masked by default — reveal only when you choose to
- Copy to clipboard directly from the results
Click the diff icon in the view header, or run EnvSwitch: Compare Profiles.
Opens a native VS Code diff editor with the two profiles side by side.
Right-click a profile → View History. Each activation creates a snapshot. Pick one to restore.
- All profile content is stored exclusively in the OS keychain (never written to disk in plaintext)
- Search results mask secret values by default
- Profiles are scoped per workspace
- The extension makes no network requests
- VS Code 1.120.0 or later
- A workspace folder must be open
git clone https://github.com/bobsk8/env-switch.git
cd env-switch
npm install
npm run compile # build once
npm run watch # watch modePress F5 in VS Code to launch the Extension Development Host.
To generate the .vsix package:
npm run package- Edit
"version"in package.json (e.g."0.4.0"→"0.5.0") - Delete the old
.vsixand rebuild:
rm -f envswitch-<old-version>.vsix
npm run package- Commit and push:
git add package.json
git commit -m "chore: bump version to X.X.X"
git push- Upload the new
envswitch-<version>.vsixto the VS Code Marketplace
This extension is fully open source. You can inspect every line of code, verify that no secrets leave your machine, and contribute or report issues on GitHub:
👉 github.com/bobsk8/env-switch
MIT
