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

|
10 installs
| (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 powered by custom Large Language Model (LLM) for superior accuracy in identifying potential sensitive data exposure. Features:

  • AI-Powered Analysis: Custom transformer model trained specifically for secret patterns
  • Confidence Scoring: High/Medium/Low confidence classification
  • Real-time Scanning: Instant detection during file changes
  • Learning Capability: Improves accuracy from user feedback
  • Fallback Protection: Traditional entropy-based analysis when AI unavailable

📋 Commands

dotenvy provides a comprehensive set of commands to manage your environment files. All commands are accessible via the Command Palette (Ctrl+Shift+P / ⌘+Shift+P).

🔄 Environment Manager

Core commands for managing and switching between environment files:

  • dotenvy: Switch Environment - Switch between different .env files (development, staging, production, etc.)
  • dotenvy: Open Environment Panel - Open the interactive environment management panel
  • dotenvy: Validate Environment Files - Validate .env files for syntax errors and required variables
  • dotenvy: Diff Environment Files - Compare environment files side-by-side before switching

📊 Environment History

Track and manage environment file changes over time:

  • dotenvy: View Environment History - View historical changes to environment files with timestamps and git integration

🛡️ Git Integration

Secure your commits with pre-commit hooks:

  • dotenvy: Install Git Commit Hook - Install pre-commit hook to prevent committing secrets and validation errors
  • dotenvy: Remove Git Commit Hook - Remove the installed git commit hook

☁️ Cloud Sync

Bidirectional synchronization with cloud secret managers:

  • dotenvy: Pull Environment from Cloud - Pull environment variables from Doppler (or other cloud providers)
  • dotenvy: Push Environment to Cloud - Push local environment variables to Doppler

🔍 Security

Advanced security scanning for sensitive data:

  • dotenvy: Scan for Secrets - Scan workspace for potential secrets using AI-powered analysis

💬 Support

Get help and provide feedback:

  • dotenvy: Feedback & Support - Access feedback form and support resources

⌨️ Keyboard Shortcuts

To improve productivity, consider setting up keyboard shortcuts for frequently used commands:

  1. Open Keyboard Shortcuts (Ctrl+K Ctrl+S / ⌘+K ⌘+S)
  2. Search for "dotenvy"
  3. Assign shortcuts to your most-used commands (e.g., Ctrl+Alt+E for Switch Environment)

🎮 List Commands Feature

For easy command discovery and execution, use dotenvy: List Commands which provides:

  • Interactive Quick Pick Menu: Browse all commands organized by category
  • Command Descriptions: Detailed explanations of what each command does
  • Direct Execution: Click to run any command immediately
  • Keyboard Shortcuts Setup: Built-in assistance for setting up shortcuts

📦 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