Show Menu
Cheatography

Salesforce CLI Cheat Sheet by

Salesforce CLI Quick Reference

Getting Help

Get Docume­ntation URLs
sfdx force
Force Commands Help
sfdx force -h
Another sub level example
sfdx force:org -h

Author­ization

Authorize a Sandbox Org set an alias and make it the default Dev Hub
sfdx force:­aut­h:w­eb:­login -a DevHub -d
Authorize a Prod/T­rai­lhead Org, set an alias, make it the default Org
sfdx force:­aut­h:w­eb:­login -a MyAlias -s -r https:­//l­ogi­n.s­ale­sfo­rce.com
Set default Dev Hub
sfdx force:­con­fig:set defaul­tde­vhu­bus­ern­ame­=so­me@­use­r.com
Set default Org
sfdx force:­con­fig:set defaul­tus­ern­ame­=so­me@­use­r.com
List defaults
sfdx force:­con­fig­:list

Source

Push Source to Scratch Org
sfdx force:­sou­rce­:push
Pull Source from Scratch Org
sfdx force:­sou­rce­:pull
Local & Remote Source Code Changes
sfdx force:­sou­rce­:status

Packages

Create
sfdx force:­pac­kag­e:v­ersion create
Install
sfdx force:­pac­kag­e:i­nstall
Promote
sfdx force:­pac­kag­e:v­ers­ion­:pr­omote

Data

Import
sfdx force:­dat­a:t­ree­:import --plan data/s­amp­le-­dat­a-p­lan.json
Export
sfdx force:­dat­a:t­ree­:export -h
 

Org

Get a list of connected Orgs
sfdx force:­org­:list
Open Current Org in Browser
sfdx force:­org­:open
Delete an Org
sfdx force:­org­:delete -u MyOrgAlias -p
Create Scratch Org and make default Org
sfdx force:­org­:create -a MyAlias -s -f config­\pr­oje­ct-­scr­atc­h-d­ef.json -d 7

Dreamhouse Example Script

cd dreamh­ous­e-sfdx
sfdx force:­con­fig:set defaul­tde­vhu­bus­ern­ame­=yo­ur@­use­rna­me.com
sfdx force:­org­:create -a dreamhouse -s -f config­\pr­oje­ct-­scr­atc­h-d­ef.json -d 7
sfdx force:­sou­rce­:push
sfdx force:­use­r:p­erm­set­:assign -n dreamhouse
sfdx force:­org­:open -p /light­nin­g/p­age­/home

Other

Org Limits
sfdx force:­lim­its­:ap­i:d­isplay
Update the Salesforce CLI
sfdx update
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Salesforce Javascript Functional Cheat Sheet

          More Cheat Sheets by GregFinzer

          T4 Templates Cheat Sheet
          5 Stages of Spiritual Growth Cheat Sheet
          15 Factors That Focus Bible Study Cheat Sheet