// docsv1.3.6

VS Code Extension

Real-time environment variable sync inside VS Code and Cursor with live revocation, commit guards, and multi-directory support.

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:

VS Code Marketplace

Cursor — open the Extensions sidebar and search "Envpilot". The same extension works in both editors.

Requires VS Code 1.85+ or Cursor equivalent.

Authenticate#

  1. Open the command palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Run Envpilot: Sign In
  3. Your browser opens to the Envpilot authentication page
  4. 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.

  1. Run Envpilot: Link Project from the command palette
  2. Select your organization and project
  3. Choose which environments to sync (development, staging, production)
  4. 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 .env file 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:

  1. VS Code staging guard — warns when you stage a .env file and offers to unstage it
  2. Pre-commit hook — a git hook that blocks commits containing .env files 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.

terminal
my-monorepo/
├── apps/api/.env production
├── apps/web/.env.local development
└── packages/sdk/.env staging

Use 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#

CommandPalette name
envpilot.signInEnvpilot: Sign In
envpilot.signOutEnvpilot: Sign Out
envpilot.linkProjectEnvpilot: Link Project
envpilot.unlinkProjectEnvpilot: Unlink Project
envpilot.pullVariablesEnvpilot: Pull Variables
envpilot.refreshEnvpilot: Refresh
envpilot.openDashboardEnvpilot: Open Dashboard
envpilot.showStatusEnvpilot: Show Status
envpilot.addDirectoryEnvpilot: Add Directory
envpilot.removeDirectoryEnvpilot: Remove Directory
envpilot.selectEnvironmentsEnvpilot: Select Environments
envpilot.requestVariableEnvpilot: Request Variable
envpilot.installCommitGuardEnvpilot: Install Commit Guard Hook
envpilot.removeCommitGuardEnvpilot: Remove Commit Guard Hook
envpilot.openDashboardPanelEnvpilot: Open Dashboard Panel

Settings reference#

Configure in VS Code Settings (Cmd+,) under "Envpilot".

SettingTypeDefaultDescription
envpilot.autoSyncbooleantrueAutomatically sync variables when workspace opens
envpilot.syncIntervalnumber300Interval (in seconds) for checking permission changes
envpilot.targetFilestring".env.local"Default target file for synced variables
envpilot.environmentstring"development"Default environment for synced variables
envpilot.preventCopyOnRevokebooleantrueDelete synced .env files when permissions are revoked
envpilot.defaultConflictResolutionstring"prompt"Default action when existing .env files are found
envpilot.enableMultiDirectorySyncbooleantrueAllow linking multiple directories to the same project
envpilot.syncOnDirectoryOpenbooleantrueAutomatically sync when opening a linked directory
envpilot.enableCodeLensbooleantrueShow CodeLens annotations above .env files with sync status and actions
envpilot.commitGuard.enabledbooleantrueEnable dual-layer .env commit protection (VS Code staging guard + pre-commit hook)
envpilot.commitGuard.autoInstallHookbooleantrueAutomatically install a pre-commit hook to block .env file commits