A VS Code extension that automatically keeps your .env template files in sync with your actual .env files, maintaining a clear record of required environment variables without exposing sensitive data.
Features
- 🔄 Auto-sync
.env
files with templates
- 🖊️ Customizable source and destination file names
- 🔧 Configurable placeholder format
- 📈 Status bar indicator for sync status
- 🔔 Optional notifications for sync events
Installation
- Open Visual Studio Code
- Press
Ctrl+P
(or Cmd+P
on macOS) to open the Quick Open dialog
- Type
ext install inci-august.echo-env
to find the extension
- Click the "Install" button
Usage
- Open a project with
.env
files
- The extension will automatically watch for changes in your
.env
files
- When changes are detected, it will update the corresponding template files
- You can also manually trigger a sync by clicking the
echoEnv
item in the status bar
Example
Given a .env
file:
DATABASE_URL=postgres://username:password@localhost:5432/mydb
API_KEY=1234567890abcdef
DEBUG=true
echo.env will automatically generate or update a .env.example
file:
DATABASE_URL=database_url
API_KEY=api_key
DEBUG=debug
Configuration
Customize the extension's behavior in your VSCode settings:
{
"echoEnv.sourceFiles": [
".env.local",
".env.development",
".env.dev",
".env.test",
".env.staging",
".env"
],
"echoEnv.destinationFiles": [
".env.template",
".env.example",
".env.sample",
".env.defaults",
".env.dist"
],
"echoEnv.placeholderFormat": "${key}",
"echoEnv.showNotifications": true
}
echoEnv.sourceFiles
: List of source files to watch for changes
echoEnv.destinationFiles
: List of destination files to update
echoEnv.placeholderFormat
: Format for placeholder values in destination files
echoEnv.showNotifications
: Enable or disable notifications for successful syncs (default: true)
License
This project is licensed under the MIT License. See the LICENSE file for details.