Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Salesforce DotEnvNew to Visual Studio Code? Get it now.
Salesforce DotEnv

Salesforce DotEnv

Jonathan Gillespie

|
3 installs
| (0) | Free
Provides support for loading environment variables from .env files for Salesforce's VSCode Extensions
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Salesforce DotEnv VS Code Extension

This extension loads environment variables from .env files for Salesforce development.

Features

  • Loads environment variables from .env files for Salesforce extensions
  • Customizable .env file paths to match your naming conventions
  • Optional auto-reload when .env file changes (configurable)
  • Integrates specifically with Salesforce VS Code extensions
  • Enhanced status bar showing current .env file and variable count
  • Switch between multiple .env files in the workspace
  • Manual reload of current environment file

Usage

  1. Install this extension in VS Code
  2. Create a .env file in your Salesforce project root
  3. Environment variables will be automatically loaded
  4. Status bar shows current .env file and variable count
  5. Click status bar to reload current environment file or switch between different .env files

Configuration

  • sf-dotenv.envFile: Path to the .env file to automatically load (defaults to .env)
  • sf-dotenv.showInfoMessages: Show info messages when environment variables are reloaded
  • "sf-dotenv.envFilePatterns: Configurable glob patterns to search for environment files"

How it works

The extension monitors your .env file for changes and:

  • Loads environment variables into the extension host
  • Updates VS Code settings for Salesforce extensions
  • Updates terminal environment variables
  • Enhanced status bar shows current file and variable count
  • File discovery finds all .env files in the workspace
  • Quick switching between different environment files

Commands

  • sf-dotenv.loadEnvFile: Load environment variables from .env file
  • sf-dotenv.selectEnvFile: Switch to a different .env file
  • sf-dotenv.reloadEnvFile: Reload the current environment file
  • sf-dotenv.showMenu: Show the Salesforce DotEnv menu
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft