This Local add-on automatically configures VS Code's integrated terminal with the correct environment variables for your LocalWP site. This allows you to run php, mysql, wp, and composer commands directly from VS Code's terminal without any additional setup.
- One-click setup: Adds all necessary environment variables to your project's VS Code settings
- Automatic path configuration: Configures PATH to include PHP, MySQL, WP-CLI, and Composer binaries
- Cross-platform support: Works on macOS, Windows, and Linux
- Non-destructive: Merges with existing VS Code settings without overwriting custom configurations
- Site-specific: Uses the correct PHP and MySQL versions configured for each site
The add-on adds the following to your .vscode/settings.json:
PATH- Includes LocalWP's PHP, MySQL, WP-CLI, and Composer binariesPHPRC- Points to the site's PHP configurationMYSQL_HOME- Points to the site's MySQL configurationWP_CLI_CONFIG_PATH- WP-CLI configuration pathWP_CLI_DISABLE_AUTO_CHECK_UPDATE- Disables WP-CLI update checksMAGICK_CODER_MODULE_PATH- ImageMagick modules (if available)DISABLE_AUTO_TITLE- Prevents terminal title flickering
terminal.integrated.cwd- Sets working directory towp-contentterminal.integrated.shellIntegration.enabled- Enables shell integration
- Open your site in Local
- Go to the Tools tab
- Click "VS Code Terminal" in the sidebar
- Click "Add Terminal Environment to VS Code"
- Open your project in VS Code
- Open a new terminal - it will automatically have access to PHP, MySQL, WP-CLI, and Composer
Note: The site must be running in Local for the commands to work (MySQL socket requires an active connection).
- Download the latest
local-addon-vscode-terminal.zipfrom Releases - Extract the zip file
- Move the
local-addon-vscode-terminalfolder to your Local add-ons directory:- macOS:
~/Library/Application Support/Local/addons/ - Windows:
%APPDATA%\Local\addons\ - Linux:
~/.config/Local/addons/
- macOS:
- Restart Local
- Local 6.5.2 or later
- VS Code or any compatible editor (Cursor, VS Codium, etc.)
- The site must be running in Local for the environment to work correctly
# Install dependencies
npm install --legacy-peer-deps
# Build the add-on
npm run build
# Watch for changes
npm run watch- Build the add-on
- Copy the folder to your Local add-ons directory:
- macOS:
~/Library/Application Support/Local/addons/ - Windows:
%APPDATA%\Local\addons\ - Linux:
~/.config/Local/addons/
- macOS:
- Restart Local
MIT
Inspired by the Xdebug + VS Code add-on by Pixel Jar.