VS Code Extension
Envpilot v1.3.6 for VS Code and Cursor. Real-time sync, automatic revocation, and commit guards.
Install#
VS Code — search for "Envpilot" in the Extensions sidebar, or install directly:
Cursor — open the Extensions sidebar and search "Envpilot". The same extension works in both editors.
Requires VS Code 1.85+ or Cursor equivalent.
Authenticate#
- Open the command palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run Envpilot: Sign In
- Your browser opens to the Envpilot authentication page
- Confirm in the browser — the extension picks up the session automatically
The extension stores your session in VS Code's secure credential storage. To sign out, run Envpilot: Sign Out.
Link a project#
- Run Envpilot: Link Project from the command palette
- Select your organization and project
- Choose which environments to sync (development, staging, production)
- Variables are pulled to your configured target file (default:
.env.local)
Once linked, the extension syncs automatically when you open the workspace. The Envpilot sidebar in the Activity Bar shows your linked projects and variables.
How sync works#
- On workspace open, the extension pulls the latest variables and writes them to your target file
- A background timer checks for permission changes every 5 minutes (configurable)
- If your access is revoked, the extension detects it via the permission check and automatically deletes the synced
.envfile to prevent unauthorized access - Manual sync: run Envpilot: Pull Variables from the command palette
Commit guard#
The extension includes dual-layer protection against committing .env files:
- VS Code staging guard — warns when you stage a
.envfile and offers to unstage it - Pre-commit hook — a git hook that blocks commits containing
.envfiles at the git level
Both are enabled by default. To install or remove the git hook manually:
- Envpilot: Install Commit Guard Hook
- Envpilot: Remove Commit Guard Hook
Multi-directory sync#
Link multiple directories in the same workspace to different projects or environments. Each directory syncs independently.
my-monorepo/
├── apps/api/.env ← production
├── apps/web/.env.local ← development
└── packages/sdk/.env ← stagingUse Envpilot: Add Directory and Envpilot: Remove Directory to manage linked paths.
Requesting a variable#
Members who need access to a variable they cannot see can run Envpilot: Request Variable from the command palette. This creates a request that a Team Lead or Admin approves from the dashboard.
Command reference#
| Command | Palette name |
|---|---|
envpilot.signIn | Envpilot: Sign In |
envpilot.signOut | Envpilot: Sign Out |
envpilot.linkProject | Envpilot: Link Project |
envpilot.unlinkProject | Envpilot: Unlink Project |
envpilot.pullVariables | Envpilot: Pull Variables |
envpilot.refresh | Envpilot: Refresh |
envpilot.openDashboard | Envpilot: Open Dashboard |
envpilot.showStatus | Envpilot: Show Status |
envpilot.addDirectory | Envpilot: Add Directory |
envpilot.removeDirectory | Envpilot: Remove Directory |
envpilot.selectEnvironments | Envpilot: Select Environments |
envpilot.requestVariable | Envpilot: Request Variable |
envpilot.installCommitGuard | Envpilot: Install Commit Guard Hook |
envpilot.removeCommitGuard | Envpilot: Remove Commit Guard Hook |
envpilot.openDashboardPanel | Envpilot: Open Dashboard Panel |
Settings reference#
Configure in VS Code Settings (Cmd+,) under "Envpilot".
| Setting | Type | Default | Description |
|---|---|---|---|
envpilot.autoSync | boolean | true | Automatically sync variables when workspace opens |
envpilot.syncInterval | number | 300 | Interval (in seconds) for checking permission changes |
envpilot.targetFile | string | ".env.local" | Default target file for synced variables |
envpilot.environment | string | "development" | Default environment for synced variables |
envpilot.preventCopyOnRevoke | boolean | true | Delete synced .env files when permissions are revoked |
envpilot.defaultConflictResolution | string | "prompt" | Default action when existing .env files are found |
envpilot.enableMultiDirectorySync | boolean | true | Allow linking multiple directories to the same project |
envpilot.syncOnDirectoryOpen | boolean | true | Automatically sync when opening a linked directory |
envpilot.enableCodeLens | boolean | true | Show CodeLens annotations above .env files with sync status and actions |
envpilot.commitGuard.enabled | boolean | true | Enable dual-layer .env commit protection (VS Code staging guard + pre-commit hook) |
envpilot.commitGuard.autoInstallHook | boolean | true | Automatically install a pre-commit hook to block .env file commits |