.env.example Generator Extension
Table of Contents
- Overview
- Features
- Installation
- Usage
- Contributing
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
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
- Open Visual Studio Code.
- Go to the Extensions view (Ctrl+Shift+X).
- Search for
.env.example-generator
or click the link to the marketplace.
- Click Install
For contributing
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.
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
}
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!