Monday, June 15, 2020

SFDC CLI Introduction


Sa
    lesforce CLI :-
     
          Contents:



  1. What is CLI?
  2. Difference between CLI and SFDX?
  3. Different CLI Commands

CLI (Command Line Interface):- This is a powerful tool which simplifies development and build automation when working with salesforce Org.
  • create and manage Orgs
  • you can create and delete scratch orgs, manage and authorize developer, production and sandbox orgs.
  • Synchronize source to and from scratch org.
  • create and test Apex classes, triggers, VF pages , Lightning web components etc..
  • Import and export Data.
  • create and Install Packages
  • helps to build automation
Advantages of CLI
  • Point and click -- No// with help of CLI command you can perform the point and click task faster with out going to the user interface.
  • for ex: If you want to create a "user" for  your org, you can directly create a user from CLI.
  • Perform task faster - CLI executes fast.
  • Better consistency - has per the command options you can enter the values.
  • Less chances of error - due to command options there will be less error, with perfect values.
  • Build Automation with scripts - you can group more than 1 commands in a script to execute automatically.
Difference between SFCLI and SFDX:-        Salesforce CLI is a tool with commands and their parameters and SFDX is an approach, where you can create a scratch org to do your new requirement and later you can copy the source to your production or sandbox org, after copying the metadata you can delete that particular scratch org and again you can start with a new scratch org for new requirement.

To Install CLI :- 
Please follow this link Salesforce CLI.
after installation open cmd and enter sfdx --version, If installation successful no error and shows the version like sfdx-cli/7.61.0. If you want to update, enter sfdx update

How to use few CLI commands:-
  • To display, list of all commands enter "sfdx commands"


If you want to deep drive on each command than type help on each command.
  1.  for namespace command -"sfdx force -h"
  2. for topic -"sfdx force:apex -h"
  3. for subtopic-"sfdx force:apex:class-h"
  4. for commands -"sfdx force:apex:class:create -h"

Note:- To see signatures for all commands in the force namespace, run sfdx force:doc:commands:list --usage.
here
Let's go with an example  :-
sfdx force:user:list -h
This helps you to display the documentation of that command.
like Usage, Options and Description.
It also show's some example with description.




`



x

No comments:

Post a Comment