Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>ENV Switcher Pro — One Click .env SwitchingNew to Visual Studio Code? Get it now.
ENV Switcher Pro — One Click .env Switching

ENV Switcher Pro — One Click .env Switching

khavjhav

| (0) | Free
Switch between .env files in one click. Auto-detects variants, shows diffs, restarts terminals, validates against .env.example. Zero config.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ENV Switcher Pro — One Click .env Switching

Switch between .env files in one click. Terminals auto-restart.

Zero config. Just install — it auto-detects your .env files.

Features

  • Auto-detection — finds all .env* files in your workspace
  • One-click switch — status bar shows active env, click to change
  • Diff preview — see what changes before switching (+3, -1, ~2)
  • Terminal auto-restart — terminals restart to pick up new env vars
  • Missing var warnings — compares .env vs .env.example
  • Color-coded status bar — green = local/dev, yellow = staging, red = production
  • Backup on switch — saves .env.bak before overwriting
  • Inline annotation — shows "sourced from .env.staging" when viewing .env

Getting Started

  1. Install from VS Code Marketplace
  2. Create your env variants (e.g. .env.local, .env.staging, .env.production)
  3. Click the status bar item to switch

Settings

Setting Default Description
envSwitcherPro.enable true Master on/off
envSwitcherPro.autoRestartTerminals true Restart terminals on switch
envSwitcherPro.validateAgainstExample true Warn about missing vars vs .env.example
envSwitcherPro.showInlineDecorations true Show source annotation in .env
envSwitcherPro.backupOnSwitch true Backup .env before overwriting
envSwitcherPro.excludePatterns [".env.vault", ".env*.bak"] Files to exclude
envSwitcherPro.statusBarColors {} Custom color mapping per env name

Commands

Command Description
ENV Switcher: Switch Environment Open env picker
ENV Switcher: Validate Missing Variables Check .env vs .env.example

How It Works

  1. On activation, scans workspace for .env* files
  2. Hashes .env content and compares against variants to detect which is active
  3. On switch: copies selected file to .env, restarts terminals, updates status bar
  4. File watcher re-scans on any .env* file create/delete/change

License

MIT

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