Newer Version Available
Use a Sample Repo to Get Started
The quickest way to get going with Salesforce DX is to clone the dreamhouse-lwc GitHub repo. Use its configuration files and
Salesforce application to try some commonly used Salesforce CLI commands.
-
Open a terminal or command prompt window, and clone the dreamhouse-lwc GitHub
sample repo using HTTPS or SSH.
1git clone https://github.com/trailheadapps/dreamhouse-lwc.git 2--or-- 3git clone git@github.com:trailheadapps/dreamhouse-lwc.git -
Change to the dreamhouse-lwc project
directory.
1cd dreamhouse-lwc -
Authorize your Developer Hub (Dev Hub) org, set it as your default, and assign
it an alias.
1sfdx force:auth:web:login --setdefaultdevhubusername --setalias DevHubEnter your Dev Hub org credentials in the browser that opens. After you log in successfully, you can close the browser. -
Create a scratch org using the config/project-scratch-def.json file, set the username as your
default, and assign it an alias.
1sfdx force:org:create --setdefaultusername -f config/project-scratch-def.json --setalias my-scratch-org -
Push source and tests, located in the force-app directory, to the scratch org.
1sfdx force:source:push -
Assign the dreamhouse permission set to
the default user.
1sfdx force:user:permset:assign -n dreamhouse -
Import sample data into the scratch org.
1sfdx force:data:tree:import -p data/sample-data-plan.json -
Run Apex tests.
1sfdx force:apex:test:run --resultformat human -
Open the scratch org and view the pushed metadata under Most Recently
Used.
1sfdx force:org:open - In App Launcher, find and open Dreamhouse.