Newer Version Available
Use a Sample Repo to Get Started
The quickest way to get going with Salesforce DX is to clone the sfdx-simple GitHub repo. Use its configuration files and
Force.com application to try some commonly used Salesforce CLI commands.
-
Open a terminal or command prompt window, and clone the sfdx-simple GitHub sample repo using HTTPS or SSH.
1git clone https://github.com/forcedotcom/sfdx-simple.git 2--or-- 3git clone git@github.com:forcedotcom/sfdx-simple.git -
Change to the sfdx-simple project directory.
1cd sfdx-simple -
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 -
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