EnvSync - VS Code Extension
Sync your .env files across projects via secure cloud storage.
Features
- Secure Storage - Environment files are encrypted client-side before uploading
- Project Isolation - Each project uses its own cloud storage
- Version History - Track changes and restore previous versions
- Auto-Sync - Automatically push changes when files are modified (optional)
- Multi-File Support - Sync multiple
.env files (.env, .env.local, .env.development, etc.)
- Cross-Device Access - Access your env files from any machine
Installation
From VSIX
code --install-extension env-sync-0.0.1.vsix
From VS Marketplace (Coming Soon)
Search "EnvSync" in the Extensions Marketplace.
Quick Start
1. Login
- Open Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Run
EnvSync: Login
- Choose Email (Magic Link)
- Enter your email address
- Check your inbox for a 6-digit code
- Enter the code to complete login
2. Push Your First .env
- Open a project with a
.env file
- Run
EnvSync: Push to Cloud
- Select or create a project name (e.g.,
yourname/my-app)
- Done! Your
.env is now synced.
3. Pull on Another Machine
- Login with the same email
- Run
EnvSync: Pull from Cloud
- Select your project
- Your
.env file is restored
Usage
Push to Cloud
EnvSync: Push to Cloud
Uploads your .env file to the cloud. Shows a quick-pick if you have multiple .env files.
Pull from Cloud
EnvSync: Pull from Cloud
Downloads the latest version from the cloud. Creates a backup file before overwriting.
Smart Sync
EnvSync: Sync
Compares local and remote versions:
- If local is newer → prompts to push
- If remote is newer → prompts to pull
- If new file → prompts to push
View History
Open the EnvSync History sidebar to:
- See all synced
.env files
- Browse version history for each file
- Restore previous versions with one click
Auto-Sync (Optional)
Enable automatic syncing when files change:
- Open Settings
- Search for
EnvSync: Auto Sync
- Set to
true
Project Management
Project IDs
Projects are identified by user-scoped IDs:
- Format:
username/project-name
- Example:
nelson/my-web-app
This prevents collisions between users with similarly-named projects.
Local Config
Your project choice is saved to .envsync.json in your project root:
{
"projectId": "nelson/my-app"
}
This file is automatically gitignored.
Switching Projects
To change which cloud project a local folder syncs to:
- Delete
.envsync.json from your project root
- Run
EnvSync: Push to Cloud
- Select a different project
Security
Client-Side Encryption
All .env content is encrypted before it leaves your machine:
- Algorithm: AES-256-GCM
- Key Derivation: PBKDF2 (100,000 iterations)
- Key Source: Your email + machine ID (unique per device)
The server never sees your unencrypted environment variables.
Access Tokens
Stored in VS Code's secure storage (context.secrets):
- Never exposed in logs
- Survives VS Code restarts
- Cleared on logout
Configuration
| Setting |
Default |
Description |
envsync.apiUrl |
Production URL |
API endpoint (only change for self-hosting) |
envsync.filePatterns |
.env, .env.local, .env.development |
Files to sync |
envsync.autoSync |
false |
Auto-sync on file changes |
Troubleshooting
"Please login first"
Your session may have expired. Run EnvSync: Login again.
"Project not found in cloud"
This is a new project. Push it first with EnvSync: Push to Cloud.
Version history shows "No version history available"
The file hasn't been pushed to cloud yet, or this is the first version.
Auto-sync not working
- Ensure
envsync.autoSync is set to true
- Check that file patterns match your
.env files
- Verify you're logged in
Self-Hosting
To use your own Supabase instance:
- Deploy the Supabase functions from
supabase/ folder
- Update
envsync.apiUrl in VS Code settings
{
"envsync.apiUrl": "https://your-project.supabase.co/functions/v1"
}
Development
Build
bun install
bun run compile # Type-check
bun run build # Bundle with webpack
bun run package # Create .vsix
Deploy Backend
cd supabase
supabase link --project-ref your-project-ref
supabase db push --linked
supabase functions deploy auth --no-verify-jwt
supabase functions deploy files --no-verify-jwt
License
MIT