Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Salesforce CLI Cheat Sheet


Published on

Cheat sheet for Salesforce CLI 'force' topic commands.

Published in: Internet
  • Login to see the comments

Salesforce CLI Cheat Sheet

  1. 1.   Salesforce CLI Cheat Sheet  All commands are in the force namespace, so you must prefix with ​sfdx force:​ - e.g. ​sfdx force:org:list  Most commands require a user or alias to be specified via the ​-u​ switch    SETUP    AUTHENTICATION    CONVERT  Create project    Login to an org    To source format  project:create -n ​dir    auth:web:login {-a alias}    mdapi:convert -r ​mdapiDir ​-d ​srcDir  Create scratch org    Set default dev hub    From source format  org:create -f ​config_file    config:set defaultdevhubusername=​user    source:convert -r ​srcDir ​-d ​mdapiDir  Generate password    Set default scratch org      user:password:generate     config:set defaultusername=​user    TESTING  Delete scratch org    List valid authenticated orgs    Run single test  org:delete     org:list    apex:test:run -t ​class.method      List authenticated orgs    Run all tests in class  MIGRATING CODE/CONFIG    auth:list    apex:test:run -t ​class  Push to scratch org    Open an org    Run all tests in org namespace  source:push    org:open     apex:test:run -l RunLocalTests  Pull from scratch org    Logout of an org    Run all tests in org  source:pull    org:logout     apex:test:run -l RunAllTestsInOrg  Deploy metadata        Extract code coverage  mdapi:deploy -d ​dir    DATA    apex:test:run -c -r human  Retrieve metadata    Create a record    Run tests when deploying  mdapi:retrieve -r ​dir    data:record:create -s ​sobject​ -v ​fields    mdapi:deploy -l RunLocalTests  Cancel metadata deployment    Update a record      mdapi:deploy:cancel -i ​jobid    data:record:update​ ​-s ​sobject​ -i ​id​ -v ​fields    OTHER      Retrieve a record    Display limits  PACKAGING    data:record:get -s ​sobject ​-i ​id    limits:api:display  Create Package    SOQL Query    List debug logs  package:create -n ​name​ -t ​type ​-r ​dir    data:soql:query​ ​-q ​query    apex:log:list  Install Package    Delete a record    Retrieve debug log  package:install -p ​id/alias ​-k ​password    data:record:delete​ ​-s ​sobject​ -i ​id    apex:log:get -i ​logId ​-n ​lines  Create Package Version    Bulk upsert    Assign permission set  package:version:create -p ​id/alias​ -d ​dir   ​-k ​password    data:bulk:upsert​ ​-s ​sobject​ -i ​externalId   -f ​file    user:permset:assign -n ​permsetname   -​u ​user ​-o ​users      Bulk delete    Execute apex      data:bulk:delete -s ​sobject​ -f ​file    apex:execute {-f ​apexFile​}      Bulk status          data:bulk:status -i ​jobId​ -b ​batchId      Keir Bowden, July 2019