Skip to content
| Marketplace
Sign in
Visual Studio Code>Extension Packs>.env.example-generatorNew to Visual Studio Code? Get it now.
.env.example-generator

.env.example-generator

manaskpradhan

|
491 installs
| (1) | Free
A Visual Studio Code extension that automatically generates .env.example files based on existing .env files in your workspace. Simplify your development process by ensuring consistent environment variable configurations across your projects. Additionally, it automatically generates .gitignore files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

.env.example Generator Extension

Table of Contents

  1. Overview
  2. Features
  3. Installation
  4. Usage
  5. Contributing

BY Manas Kumar Pradhan

pkmanas22

Overview

  • The .env.example Generator is a Visual Studio Code extension that automatically generates .env.example files based on the existing .env files in your workspace.
  • This ensures consistent environment variable configurations across your projects while also generating .gitignore files to exclude sensitive environment files from version control.

Screenshot

Usage

Screenshot 1 Screenshot 2 .gitignore

Features

  • Automatically creates .env.example files from .env files in the workspace.
  • Optionally includes comments in the generated .env.example file to guide developers.
  • Automatically updates .gitignore files to ignore .env files.
  • Debounced updates to handle rapid changes in .env files.
  • Toggle comments in .env.example through workspace settings.

Installation

For using

  1. Open Visual Studio Code.
  2. Go to the Extensions view (Ctrl+Shift+X).
  3. Search for .env.example-generator or click the link to the marketplace.
  4. Click Install

For contributing

  • If you'd like to contribute to the development of this extension, follow the setup instructions below:

  • Setup for Development

1. Clone the repository:

git clone https://github.com/pkmanas22/.env.example-generator-extension.git

cd .env.example-generator-extension

2. Install dependencies:

You’ll need Node.js installed (preferably version 18.x or later). Then, run the following command to install dependencies:

yarn install

3. Open the project in VS Code:

Open the project folder in Visual Studio Code:

code .

4. Launch Extension:

Press F5 to start the extension in a new VS Code window (Extension Development Host).

Usage

1. Enable Automatic .env.example Generation:

The extension will automatically generate and update .env.example files whenever you modify .env files in your workspace.

2. Permissions:

When a .env file is detected, you may be prompted to confirm if you want to create or updatethe.env.example and .gitignore files. You can choose to do this immediately or later.

prompt

3. Toggle Comments in .env.example:

You can enable or disable the inclusion of comments in the .env.example files by changing the workspace setting:

  1. Open Command Palette (Ctrl+Shift+P).
  2. Search for Toggle Include Comments in .env.example.
  3. Toggle between enabling or disabling comments.
.vscode\settings.json

{
    "envExample.includeComments": false
}

Contributing

1. Fork and clone the repository:

git clone https://github.com/[YOUR_USER_NAME]/.env.example-generator-extension

2. Create a new branch:

git checkout -b feature/your-feature-name

3. Make your changes and commit them:

git commit -m "Add your changes"

4. Push your changes:

git push origin feature/your-feature-name

5. Submit a Pull Request to the main repository.

Thank you for reading!

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