Set Up Einstein for Developers

Einstein for Developers (Beta) is available in the VS Code and Open VSX marketplaces as a part of the Salesforce Expanded Pack. Any developer with access to a Salesforce org can use the extension to generate Apex code from natural language instructions, get coding suggestions using line autocomplete, or generate Apex unit tests to quickly accomplish required code coverage goals.

Available in: Developer, Enterprise, Partner Developer, Performance, and Unlimited Editions.

Inoperable in: Group, Professional, and Essentials Editions.

Not Available in: EU Operating Zone. EU Operating zone is a special paid offering that provides an enhanced level of data residency commitment. Einstein for Developers is supported in orgs in the EU that aren’t part of EU OZ, per standard product terms and conditions.

VS Code releases a new version each month with new features and important bug fixes. You must be on VS Code Version 1.82.0 or higher to run the Einstein for Developers extension. You can manually check for updates from Help > Check for Updates on Linux and Windows or Code > Check for Updates on macOS.

If you have multiple AI-enabled extensions installed in VS Code, you may run into some unexpected generated code outcomes. We recommend you disable all other AI-enabled extensions when working with Einstein for Developers:

  1. Click the Extensions icon in the Activity Bar, search for the extension to disable by name.
  2. Click Disable in the extension's marketplace page.
  3. Repeat for all installed AI-enabled extensions.

You can enable or disable Einstein for Developers from within Visual Studio Code or Code Builder. Click the Einstein icon in the status bar to open the command palette, then click enable or disable. The Einstein for Developers status icon in the bottom panel of the Visual Studio Code window indicates whether Einstein for Developers is enabled or disabled. When enabled, the background color of the icon matches the color of the status bar. When disabled, the background color of the icon is brown.

Einstein icon

You can disable or uninstall the Einstein for Developers extension at any time. Bring up the Extensions view by clicking the Extensions icon in the Activity Bar in VS Code or the View: Show Extensions command (⇧⌘X). Search for "Einstein for Developers" in installed extensions list, and then select Disable or Uninstall.

Einstein for Developers is disabled by default in new Code Builder environments. Telemetry is used to audit enablement of Salesforce Generative AI functionality and must be on when you enable the extension:

  1. Go to Settings and search for salesforcedx-vscode-core.telemetry.enabled to confirm that this Salesforce telemetry setting is on in your workspace.
  2. If the setting isn't on, select the checkbox to enable telemetry.
  3. Open a terminal and run sf config set disable-telemetry=false --global to enable CLI telemetry. See Salesforce CLI Data Collection and Metrics for more information.
  4. Run Developer: Reload Window.
  5. Click the Einstein icon in the status bar and enable the extension.

Salesforce telemetry is on by default and can be turned off once the extension is enabled.

Einstein for Developers is only available in scratch org editions that can author Apex:

  • Developer Edition
  • Enterprise Edition

To use Einstein for Developers in a scratch org:

  1. Enable Einstein for Developers in the Dev Hub.
  2. Use the SFDX: Authorize a Dev Hub command to log into the Dev Hub.
  3. Activate Einstein for Developers by turning on the EinsteinGPTForDevelopers scratch org feature:

Edit the config/project-scratch-def.json file in your DX project and add the “EinsteinGPTForDevelopers” feature to your existing feature list and save your changes. For example:

Create a scratch org using the SFDX: Create a Default Scratch Org... command referencing the scratch org definition that you previously updated.

Run Einstein: Show Prompt History from the Command Palette to open the console. When opened, you can view a running history of your prompts and associated responses.

You can use the default keyboard shortcuts in Visual Studio Code when using Einstein for Developers. You can rebind the shortcuts in the Keyboard Shortcuts editor using your preferred keyboard shortcuts for each specific command. For more information see Key Bindings for Visual Studio Code.

You can search for each keyboard shortcut by command name in the Keyboard Shortcuts editor.

CommandKey Binding
Accept⌘Enter
AcceptTab
ClearEscape
Einstein Code⇧⌘R
Trigger Inline Suggestion⌥\