- The
.env.exampleGenerator is a Visual Studio Code extension that automatically generates.env.examplefiles based on the existing.envfiles in your workspace. - This ensures consistent environment variable configurations across your projects while also generating
.gitignorefiles to exclude sensitive environment files from version control.
- Automatically creates
.env.examplefiles from.envfiles in the workspace. - Optionally includes comments in the generated
.env.example file to guide developers. - Automatically updates
.gitignorefiles to ignore.envfiles. - Debounced updates to handle rapid changes in
.envfiles. - Toggle comments in
.env.examplethrough workspace settings.
- Open Visual Studio Code.
- Go to the Extensions view (Ctrl+Shift+X).
- Search for
.env.example-generatoror click the link to the marketplace. - Click Install
-
If you'd like to contribute to the development of this extension, follow the setup instructions below:
-
Setup for Development
git clone https://github.com/pkmanas22/.env.example-generator-extension.git
cd .env.example-generator-extension
You’ll need Node.js installed (preferably version 18.x or later). Then, run the following command to install dependencies:
yarn install
Open the project folder in Visual Studio Code:
code .
Press F5 to start the extension in a new VS Code window (Extension Development Host).
The extension will automatically generate and update .env.example files whenever you modify .env files in your workspace.
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.
You can enable or disable the inclusion of comments in the .env.example files by changing the workspace setting:
- Open Command Palette
(Ctrl+Shift+P). - Search for
Toggle Include Comments in .env.example. - Toggle between enabling or disabling comments.
.vscode\settings.json
{
"envExample.includeComments": false
}
git clone https://github.com/[YOUR_USER_NAME]/.env.example-generator-extension
git checkout -b feature/your-feature-name
git commit -m "Add your changes"
git push origin feature/your-feature-name
Thank you for reading!




