Set Up a Salesforce DX Project and Development Org

Prepare the project and org context that the Salesforce Development plugin uses to build, test, and deploy. Install the plugin before you begin.

Open or Create a Salesforce DX Project 

Use a Salesforce DX project so the plugin can identify your project configuration and source files. If you already have a project, navigate to its directory in a terminal. Otherwise, create one and navigate to it:

1sf project generate --name my-project
2cd my-project

Authorize a Default Salesforce Org 

Use a Developer Edition org or sandbox for development. Create a scratch org only if you have a Dev Hub and want an isolated development environment.

From your project directory, authorize a default Salesforce org so the plugin knows where to run commands and deploy changes:

1sf org login web --alias my-org --set-default

For a sandbox, include --instance-url with your sandbox’s My Domain URL. If you’ve already authorized the org, set it as this project’s default with sf config set target-org=my-org, replacing my-org with its alias.

Verify the active org from the same project directory:

1sf org display --json

Next, build, test, and deploy with the Salesforce Development plugin.