Back

Salesforce DX CLI Cheat Sheet

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:source:push
Pull Source from Scratch Org
sfdx force:source:pull
Local & Remote Source Code Changes
sfdx force:source:status
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 for 7 days and make default Org
sfdx force:org:create -a MyAlias -s -f config/project-scratch-def.json -d 7
Data
Import
sfdx force:data:tree:import --plan data/sample-dataplan.json
Export
sfdx force:data:tree:export -h
Packages
Create
sfdx force:package:version create
Install
sfdx force:package:install
promote
sfdx force:package:version:promote
Most Commonly Used
Retrieve a particular file
sfdx force:source:retrieve -p c:/Users/<filepath>
Deploy a particular file
sfdx force:source:deploy -p  c:/Users/<filepath>
generate password for new scratch org
sfdx force:user:pasword:generate --scratchorgusername
Other
Update the CLI
sfdx update
Create a new project
sfdx force:project:create -n myProjectName
Org Limits
sfdx force:limits:api:display
Back
Site developed by Nikhil Karkra © 2023 | Icons made by Freepik