Make Visual Studio Code Salesforce Ready
Follow Along with Trail Together
Want to follow along with an instructor as you work through this step? Take a look at this video, part of the Trail Together series on Trailhead Live.
(This clip starts at the 7:02 minute mark, in case you want to rewind and watch the beginning of the step again.)
Install the Command Line Interface (CLI)
You can use Salesforce CLI to control the full application life cycle of your Salesforce apps. Through the CLI, you can easily create or connect to environments for development and testing, and synchronize metadata and code between your orgs and a version control system.
See the Salesforce CLI Setup Guide for complete installation instructions.
- Install the CLI from https://developer.salesforce.com/tools/sfdxcli.
- Confirm the CLI is properly installed and on the latest version by running the following command from the command line.
sfdx update
You should see output likesfdx-cli: Updating CLI....
Install the Salesforce Extension Pack
Now that we have Salesforce CLI installed, we can supercharge Visual Studio Code by installing the Salesforce Extension Pack. The extension pack installs the essential Salesforce extensions all at once, saving you from selecting each one individually.
The extensions provide deep integrations with Salesforce tooling throughout VS Code. You can invoke Salesforce CLI from a variety of places (VS Code menus, shortcut keys, and right-click context menus).
New functionality shows up as you're working, including:
- Language Services for Apex
- Language Services for Visualforce
- Language Services for Lightning Components (Aura and Lightning Web Components)
- Integrations in the activity bar for Apex tests and Replay Debugger.
- Launch Visual Studio Code.
- On the left toolbar, click Extensions.
- Enter
Salesforce Extension Packin the search field.
-
Click on
Salesforce Extension Pack. - Click Install.
- Close and relaunch Visual Studio Code to complete the installation.
Setup Your Trailhead Playground
- To create a new Trailhead Playground, click the dropdown at the end of this step and select Create a Trailhead Playground.
- Once you have a Trailhead Playground, click Launch.
- Click Setup
. - Enter
Usersin Quick Find box and select Users. - Locate your name on the list of users.
- Check the box next to your name. Make note of the username. This is the username for your Trailhead Playground.
- Click Reset Password(s) and OK. This sends a password reset email to the email address associated with your username. Check your spam folder if you don't see the email.
- Click the link in the email.
- Set your password.
We won't check any of your setup. Click Verify Step to go to the next step in the project.