Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>dotenvy – VS Code Environment ManagerNew to Visual Studio Code? Get it now.
dotenvy – VS Code Environment Manager

dotenvy – VS Code Environment Manager

FreeRave

| (0) | Free
Effortlessly manage and switch between .env files directly inside VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

dotenvy – VS Code Environment Manager

Version Publisher License: MIT VS Code Marketplace

🚀 dotenvy makes it effortless to manage and switch between your .env files directly inside VS Code. No more manual renaming or copy-pasting—just pick your environment and start coding immediately!

📥 Install from VS Code Marketplace • 📖 Documentation • 🐛 Report Issues


✨ Features

🔄 Environment Switching

Effortlessly switch between .env.development, .env.staging, .env.production, or any custom .env.* file with a single click.

📂 Auto Detection & Sync

Automatically scans your workspace for .env files and syncs seamlessly across multi-workspace setups.

🌿 Git Branch Auto-Switching

Automatically switch environments based on Git branch changes (develop → .env.development, staging → .env.staging, etc.)

✅ Environment Validation

Validate .env files for syntax errors, required variables, and type checking with custom regex patterns.

📄 Diff View

Compare environment files side-by-side before switching to preview changes and avoid surprises.

🛡️ Git Commit Security

Prevent committing sensitive data with pre-commit hooks that scan for secrets, validation errors, and block .env files.

☁️ Cloud Sync Support

Bidirectional cloud sync with Doppler Secrets Manager for team-based environment variable management.

💾 Backup & Recovery

Automatic backup creation before switching, with configurable backup paths and encryption options.

📊 Status Bar Integration

Real-time environment indicator in status bar showing current configuration, validation status, and cloud sync state.

🔍 Secrets Guard

Advanced secret detection with configurable warnings for potential sensitive data exposure.


📦 Installation

Quick Install

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / ⌘+Shift+X)
  3. Search for "dotenvy"
  4. Click Install

Alternative Methods

  • Download from VS Code Marketplace
  • Manual: Download .vsix file and install via VS Code

Requirements

  • VS Code 1.74.0 or later
  • Node.js (for cloud sync features)

🏗️ Supported Environments

Default environment files are automatically detected:

  • .env.development
  • .env.staging
  • .env.production
  • .env.test

Custom environments can be configured in .dotenvy.json.


🚀 Usage

  1. Place your environment files in your project root:

    .env.development
    .env.staging
    .env.production
    
  2. Open the Command Palette (Ctrl+Shift+P / ⌘+Shift+P).

  3. Search for:

    dotenvy: Switch Environment
    
  4. Pick the environment you want to activate.

  5. The selected file will be copied into .env automatically.

✅ The status bar will update to show the active environment.


⚙️ Configuration

You can add a config file to define custom environments, git branch auto-switching, and validation rules:

// .dotenvy.json
{
  "environments": {
    "local": ".env.local",
    "qa": ".env.qa",
    "prod": ".env.production"
  },
  "gitBranchMapping": {
    "develop": "development",
    "staging": "staging",
    "master": "production",
    "main": "production"
  },
  "autoSwitchOnBranchChange": true,
  "validation": {
    "requiredVariables": ["API_KEY", "DATABASE_URL"],
    "variableTypes": {
      "PORT": "number",
      "DEBUG": "boolean",
      "API_URL": "url"
    },
    "customValidators": {
      "EMAIL": "^[^@]+@[^@]+\\.[^@]+$"
    }
  },
  "gitCommitHook": {
    "blockEnvFiles": true,
    "blockSecrets": true,
    "blockValidationErrors": true,
    "customMessage": "Commit blocked due to security concerns"
  }
}

☁️ Cloud Sync Setup

Doppler Integration

dotenvy supports bidirectional sync with Doppler for team-based environment variable management.

Setup Steps:

  1. Create Doppler Account and project at doppler.com
  2. Generate Service Token from Doppler dashboard
  3. Add to .dotenvy.json:
{
  "cloudSync": {
    "provider": "doppler",
    "project": "your-project-name",
    "config": "development",
    "token": "dp.pt.your_token_here"
  }
}

Available Commands:

  • Pull from Cloud: dotenvy: Pull Environment from Cloud
  • Push to Cloud: dotenvy: Push Environment to Cloud

Note: Doppler tokens are stored securely using VS Code secrets storage.


🗺️ Roadmap

  • [x] Auto-switch env based on Git branch

  • [x] Environment validation

  • [x] Diff view

  • [x] Multi-workspace support

  • [x] Git commit hook to block secrets

  • [x] Cloud sync with Doppler

  • [ ] Support for other cloud providers (Vault, AWS Secrets Manager)

  • [ ] Environment variable encryption at rest

  • [ ] Shareable environment templates

  • [ ] Integration with Docker environments


🤝 Contributing

PRs are welcome! If you have ideas for features, open an issue.


📜 License

MIT © 2025 Kareem Ehab


Development

This extension is built with TypeScript. To get started:

  1. Clone the repository
  2. Run npm install
  3. Open in VS Code
  4. Press F5 to start debugging
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft