Newer Version Available

This content describes an older version of this product. View Latest

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.
  1. 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
  2. Change to the sfdx-simple project directory.
    1cd sfdx-simple
  3. Authorize your Developer Hub (Dev Hub) org, set it as your default, and assign it an alias.
    1sfdx force:auth:web:login --setdefaultdevhubusername --setalias DevHub
    Enter your Dev Hub org credentials in the browser that opens. After you log in successfully, you can close the browser.
  4. 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
  5. Push source and tests, located in the force-app directory, to the scratch org.
    1sfdx force:source:push
  6. Run Apex tests.
    1sfdx force:apex:test:run --resultformat human
  7. Open the scratch org and view the pushed metadata under Most Recently Used.
    1sfdx force:org:open