dotenvy – VS Code Environment Manager

🚀 dotenvy makes it effortless to manage and switch between your .env
files directly inside VS Code. No more manual renaming or copy-pasting—just pick your environment and start coding immediately!
📥 Install from VS Code Marketplace • 📖 Documentation • 🐛 Report Issues
✨ Features
🔄 Environment Switching
Effortlessly switch between .env.development
, .env.staging
, .env.production
, or any custom .env.*
file with a single click.
📂 Auto Detection & Sync
Automatically scans your workspace for .env
files and syncs seamlessly across multi-workspace setups.
🌿 Git Branch Auto-Switching
Automatically switch environments based on Git branch changes (develop → .env.development
, staging → .env.staging
, etc.)
✅ Environment Validation
Validate .env files for syntax errors, required variables, and type checking with custom regex patterns.
📄 Diff View
Compare environment files side-by-side before switching to preview changes and avoid surprises.
🛡️ Git Commit Security
Prevent committing sensitive data with pre-commit hooks that scan for secrets, validation errors, and block .env
files.
☁️ Cloud Sync Support
Bidirectional cloud sync with Doppler Secrets Manager for team-based environment variable management.
💾 Backup & Recovery
Automatic backup creation before switching, with configurable backup paths and encryption options.
📊 Status Bar Integration
Real-time environment indicator in status bar showing current configuration, validation status, and cloud sync state.
🔍 Secrets Guard
Advanced secret detection with configurable warnings for potential sensitive data exposure.
📦 Installation
Quick Install
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
/ ⌘+Shift+X
)
- Search for "dotenvy"
- Click Install
Alternative Methods
Requirements
- VS Code 1.74.0 or later
- Node.js (for cloud sync features)
🏗️ Supported Environments
Default environment files are automatically detected:
.env.development
.env.staging
.env.production
.env.test
Custom environments can be configured in .dotenvy.json
.
🚀 Usage
Place your environment files in your project root:
.env.development
.env.staging
.env.production
Open the Command Palette (Ctrl+Shift+P
/ ⌘+Shift+P
).
Search for:
dotenvy: Switch Environment
Pick the environment you want to activate.
The selected file will be copied into .env
automatically.
✅ The status bar will update to show the active environment.
⚙️ Configuration
You can add a config file to define custom environments, git branch auto-switching, and validation rules:
// .dotenvy.json
{
"environments": {
"local": ".env.local",
"qa": ".env.qa",
"prod": ".env.production"
},
"gitBranchMapping": {
"develop": "development",
"staging": "staging",
"master": "production",
"main": "production"
},
"autoSwitchOnBranchChange": true,
"validation": {
"requiredVariables": ["API_KEY", "DATABASE_URL"],
"variableTypes": {
"PORT": "number",
"DEBUG": "boolean",
"API_URL": "url"
},
"customValidators": {
"EMAIL": "^[^@]+@[^@]+\\.[^@]+$"
}
},
"gitCommitHook": {
"blockEnvFiles": true,
"blockSecrets": true,
"blockValidationErrors": true,
"customMessage": "Commit blocked due to security concerns"
}
}
☁️ Cloud Sync Setup
Doppler Integration
dotenvy supports bidirectional sync with Doppler for team-based environment variable management.
Setup Steps:
- Create Doppler Account and project at doppler.com
- Generate Service Token from Doppler dashboard
- Add to .dotenvy.json:
{
"cloudSync": {
"provider": "doppler",
"project": "your-project-name",
"config": "development",
"token": "dp.pt.your_token_here"
}
}
Available Commands:
- Pull from Cloud:
dotenvy: Pull Environment from Cloud
- Push to Cloud:
dotenvy: Push Environment to Cloud
Note: Doppler tokens are stored securely using VS Code secrets storage.
🗺️ Roadmap
[x] Auto-switch env based on Git branch
[x] Environment validation
[x] Diff view
[x] Multi-workspace support
[x] Git commit hook to block secrets
[x] Cloud sync with Doppler
[ ] Support for other cloud providers (Vault, AWS Secrets Manager)
[ ] Environment variable encryption at rest
[ ] Shareable environment templates
[ ] Integration with Docker environments
🤝 Contributing
PRs are welcome! If you have ideas for features, open an issue.
📜 License
MIT © 2025 Kareem Ehab
Development
This extension is built with TypeScript. To get started:
- Clone the repository
- Run
npm install
- Open in VS Code
- Press F5 to start debugging