Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>DotEnvyNew to Visual Studio Code? Get it now.
DotEnvy

DotEnvy

Thiago Vieira

|
14 installs
| (1) | Free
Quickly switch between different .env files without manually renaming them. Ideal for developers working with multiple environments like staging, production, and development.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DotEnvy

This extension helps you manage and quickly switch between environment files (.env, .env.production_*, .env.staging, etc.) in your VS Code workspace. It adds a button to the status bar, allowing you to easily copy the contents of any selected environment file into a .env file in the same directory.

DotEnvy Demo

Features

  • Adds a button to the VSCode status bar to select different environment files.
  • Allows quick replacement of .env file content with that of a selected environment file (e.g., .env.production_us, .env.staging, etc.).
  • Supports multiple .env.* files, including .env, .env.production_*, .env.staging, etc.
  • Automatically creates or overwrites the .env file in the directory of the selected file.

Usage

  1. Open a workspace in VS Code that contains environment files (.env, .env.production_*, .env.staging, etc.).
  2. Click on the "ENV" button in the status bar (bottom-right corner of VS Code).
  3. A list of available environment files in the workspace and its subdirectories will appear.
  4. Select the environment file you want to apply.
  5. The contents of the selected file will be copied into a .env file in the same directory.
    • If a .env file already exists, it will be overwritten.
    • If no .env file exists, a new one will be created.

Example Scenario

Suppose your project contains the following files:

/my-project
    ├── .env
    ├── .env.production_us
    ├── .env.production_eu
    ├── .env.staging
  • If you select .env.production_us, its content will replace .env.
  • If you navigate to a subdirectory (e.g., /my-project/backend/) that contains .env.local and select it, its content will replace /my-project/backend/.env.

Notes

  • If no environment files are found, an alert will notify you.
  • Ensure that your workspace has the necessary permissions to modify .env files.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft