SlideShare a Scribd company logo
1 of 23
Download to read offline
CLI in the C-L-E
Using the Salesforce Command Line Interface
Installing the CLI
Mac/Windows/Ubuntu:
1. https://developer.salesforce.com/tools/
sfdxcli
2. Choose your OS (Mac, Windows,
Linux)
Option 2: Install w/npm
1. Make sure node version is
LTS
2. Run npm install
@salesforce/cli
--global
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
Updating CLI
If you used the installer:
● CLI should be auto updated
● If not just run:
sf update
If you installed with npm:
● You must manually update
● Run:
npm install
--global
@salesforce/cli
https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_update_cli.htm#sfd
x_setup_update_cli
CLI & VS Code
You can run CLI using the
Salesforce CLI Integration
extension. Ctrl/CMD + Shift
+ P will guide you to most
commands. You can also
type commands manually in
the Terminal.
1. Make sure the Salesforce
Extension Pack is installed
and up to date (this
includes the Salesforce
CLI Integration)
2. Ctrl/CMD + Shift + P OR
Run from Terminal
CLI Commands
HELP!!!
sf --help or sf -h
Example:
sf --help project
retrieve start
Results give you Usage, Options &
Description
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_unified.htm
Create a Project
sf project generate -n PROJECTNAME
Creates a project folder in your current location
Connect An Org
sf org login web OR
sf org login web -r URL
Lets you connect via a Salesforce Login Screen in a
browser. 2nd version let’s you specify the instance (e.g.
https://mydomain--sandboxname.sandbox.my.salesforce.com)
sf org list
Lists the orgs you’ve authorized with their usernames and
connectivity status.
Connection to an Org
required
for the remaining
commands!
Explore the Schema
sf sobject list -s OBJECTTYPE
OBJECTTYPE includes Standard, Custom or All.
sf sobject describe -s OBJECTNAME
OBJECTNAME is the object and the
result is the object’s metadata.
Pull/Retrieve Source (Code/Metadata)
for a non-Scratch org
sf project retrieve start -m METADATATYPE
METADATATYPE includes ApexClass, ApexPage (VF),
ApexTrigger, AuraDefinitionBundle (Lightning Component),
LightningComponentBundle (LWC).
More METADATATYPES:
https://developer.salesforce.com/docs/atlas.en-us.api_meta.
meta/api_meta/meta_objects_intro.htm#!
Create New Code
sf apex generate class -n CLASSNAME
sf apex generate trigger -n TRIGGERNAME
sf visualforce generate page -n PAGENAME -l LABEL
sf lightning component generate -n COMPONENTNAME --type
aura|lwc
Note: You need to navigate to the folder
where your code needs to be first!
Deploy New or Updated Code
for a non-Scratch org
sf project deploy start -o USERNAME
Other Parameters (use only 1 of the following):
-d SOURCEPATH single file or folder
-m METADATA comma separated list of type:name,
wildcards supported
-x MANIFEST complete path of
package.xml file listing
components to deploy
Testing Code
sf apex run test -n CLASSNAME
This will run your Apex Test Class (repeat tag for multiple
classes)
Other Parameters:
-c displays code coverage results
-l LEVEL without CLASSNAME, specify level
-d PATH output results to a directory
Testing Code
sf apex run test -n CLASSNAME
This will run your Apex Test Class (repeat tag for multiple
classes)
Other Parameters:
-c displays code coverage results
-l LEVEL without CLASSNAME, specify level
-d PATH output results to a directory
Testing Code
sf force lightning lwc test run -n
TESTNAME
This will run your Lightning Jest Tests
Data
CLI commands let you
create, get and query data!
sf data create record
sf data get record
sf data query
D
E
M
O
Resources
Trailhead on the CLI
Modules
● App Development with Salesforce DX
● Command-Line Interface
● Lightning Web Components Basics
● Package Development Model
● Unlocked Packages for Customers
Trailhead on the CLI
Projects
● Quick Start: Salesforce DX
● Quick Start: Unlocked Packages
● Quick Start: Visual Studio Code for Salesforce Development
● Set Up Your Lightning Web Components Developer Tools
● Quick Start: Lightning Web Components
● Find and Fix Bugs with Apex Replay Debugger
● Build a Bear-Tracking App with Lightning Web Components
CLI Documentation
● Salesforce CLI Setup Guide
● Salesforce CLI Command Reference
● Salesforce CLI Plug-in Developers Guide
● Salesforce DX Developer Guide
● Developer Experience
● CLI in the C-L-E: Slides & Hands-on Exercise
THANK YOU

More Related Content

Similar to Cleveland Developers: CLI in the C-L-E slide deck

May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With YouDalibor Gogic
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxwilcockiris
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPANdaoswald
 
Semi-Automatic Code Cleanup with Clang-Tidy
Semi-Automatic Code Cleanup with Clang-TidySemi-Automatic Code Cleanup with Clang-Tidy
Semi-Automatic Code Cleanup with Clang-TidyMarkus Werle
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Antonio Peric-Mazar
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testersMaksim Kovalev
 
R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26zeesniper
 
Salesforce CLI Cheat Sheet
Salesforce CLI Cheat Sheet Salesforce CLI Cheat Sheet
Salesforce CLI Cheat Sheet Keir Bowden
 
Painless Perl Ports with cpan2port
Painless Perl Ports with cpan2portPainless Perl Ports with cpan2port
Painless Perl Ports with cpan2portBenny Siegert
 

Similar to Cleveland Developers: CLI in the C-L-E slide deck (20)

May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
SFDX Presentation
SFDX PresentationSFDX Presentation
SFDX Presentation
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
 
Native Hadoop with prebuilt spark
Native Hadoop with prebuilt sparkNative Hadoop with prebuilt spark
Native Hadoop with prebuilt spark
 
Open Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFVOpen Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFV
 
30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
 
Ng2 cli v1
Ng2 cli v1Ng2 cli v1
Ng2 cli v1
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Semi-Automatic Code Cleanup with Clang-Tidy
Semi-Automatic Code Cleanup with Clang-TidySemi-Automatic Code Cleanup with Clang-Tidy
Semi-Automatic Code Cleanup with Clang-Tidy
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
 
Install
InstallInstall
Install
 
Android tools for testers
Android tools for testersAndroid tools for testers
Android tools for testers
 
R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 26
 
Ex200
Ex200Ex200
Ex200
 
Salesforce CLI Cheat Sheet
Salesforce CLI Cheat Sheet Salesforce CLI Cheat Sheet
Salesforce CLI Cheat Sheet
 
LIGGGHTS installation-guide
LIGGGHTS installation-guideLIGGGHTS installation-guide
LIGGGHTS installation-guide
 
Lambda lambda-lambda
Lambda lambda-lambdaLambda lambda-lambda
Lambda lambda-lambda
 
Painless Perl Ports with cpan2port
Painless Perl Ports with cpan2portPainless Perl Ports with cpan2port
Painless Perl Ports with cpan2port
 
Pacthing
PacthingPacthing
Pacthing
 

More from Lynda Kane

Migrate to Flow
Migrate to FlowMigrate to Flow
Migrate to FlowLynda Kane
 
Rock, Paper, Scissors Game with Apex Maps
Rock, Paper, Scissors Game with Apex MapsRock, Paper, Scissors Game with Apex Maps
Rock, Paper, Scissors Game with Apex MapsLynda Kane
 
Can Orlando dance the Mambo?
Can Orlando dance the Mambo?Can Orlando dance the Mambo?
Can Orlando dance the Mambo?Lynda Kane
 
CLEDevs All about Tests
CLEDevs All about TestsCLEDevs All about Tests
CLEDevs All about TestsLynda Kane
 
Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022Lynda Kane
 
Salesforce Character Cards.pdf
Salesforce Character Cards.pdfSalesforce Character Cards.pdf
Salesforce Character Cards.pdfLynda Kane
 
2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdfLynda Kane
 
CLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global GatheringCLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global GatheringLynda Kane
 

More from Lynda Kane (8)

Migrate to Flow
Migrate to FlowMigrate to Flow
Migrate to Flow
 
Rock, Paper, Scissors Game with Apex Maps
Rock, Paper, Scissors Game with Apex MapsRock, Paper, Scissors Game with Apex Maps
Rock, Paper, Scissors Game with Apex Maps
 
Can Orlando dance the Mambo?
Can Orlando dance the Mambo?Can Orlando dance the Mambo?
Can Orlando dance the Mambo?
 
CLEDevs All about Tests
CLEDevs All about TestsCLEDevs All about Tests
CLEDevs All about Tests
 
Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022Cleveland Salesforce Developers 8/13/2022
Cleveland Salesforce Developers 8/13/2022
 
Salesforce Character Cards.pdf
Salesforce Character Cards.pdfSalesforce Character Cards.pdf
Salesforce Character Cards.pdf
 
2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf2022 WITness Success #Craftforce.pdf
2022 WITness Success #Craftforce.pdf
 
CLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global GatheringCLE TrailheaDX 2020 Global Gathering
CLE TrailheaDX 2020 Global Gathering
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Cleveland Developers: CLI in the C-L-E slide deck

  • 1. CLI in the C-L-E Using the Salesforce Command Line Interface
  • 2. Installing the CLI Mac/Windows/Ubuntu: 1. https://developer.salesforce.com/tools/ sfdxcli 2. Choose your OS (Mac, Windows, Linux) Option 2: Install w/npm 1. Make sure node version is LTS 2. Run npm install @salesforce/cli --global https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
  • 3. Updating CLI If you used the installer: ● CLI should be auto updated ● If not just run: sf update If you installed with npm: ● You must manually update ● Run: npm install --global @salesforce/cli https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_update_cli.htm#sfd x_setup_update_cli
  • 4. CLI & VS Code You can run CLI using the Salesforce CLI Integration extension. Ctrl/CMD + Shift + P will guide you to most commands. You can also type commands manually in the Terminal. 1. Make sure the Salesforce Extension Pack is installed and up to date (this includes the Salesforce CLI Integration) 2. Ctrl/CMD + Shift + P OR Run from Terminal
  • 6. HELP!!! sf --help or sf -h Example: sf --help project retrieve start Results give you Usage, Options & Description https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_unified.htm
  • 7. Create a Project sf project generate -n PROJECTNAME Creates a project folder in your current location
  • 8. Connect An Org sf org login web OR sf org login web -r URL Lets you connect via a Salesforce Login Screen in a browser. 2nd version let’s you specify the instance (e.g. https://mydomain--sandboxname.sandbox.my.salesforce.com) sf org list Lists the orgs you’ve authorized with their usernames and connectivity status.
  • 9. Connection to an Org required for the remaining commands!
  • 10. Explore the Schema sf sobject list -s OBJECTTYPE OBJECTTYPE includes Standard, Custom or All. sf sobject describe -s OBJECTNAME OBJECTNAME is the object and the result is the object’s metadata.
  • 11. Pull/Retrieve Source (Code/Metadata) for a non-Scratch org sf project retrieve start -m METADATATYPE METADATATYPE includes ApexClass, ApexPage (VF), ApexTrigger, AuraDefinitionBundle (Lightning Component), LightningComponentBundle (LWC). More METADATATYPES: https://developer.salesforce.com/docs/atlas.en-us.api_meta. meta/api_meta/meta_objects_intro.htm#!
  • 12. Create New Code sf apex generate class -n CLASSNAME sf apex generate trigger -n TRIGGERNAME sf visualforce generate page -n PAGENAME -l LABEL sf lightning component generate -n COMPONENTNAME --type aura|lwc Note: You need to navigate to the folder where your code needs to be first!
  • 13. Deploy New or Updated Code for a non-Scratch org sf project deploy start -o USERNAME Other Parameters (use only 1 of the following): -d SOURCEPATH single file or folder -m METADATA comma separated list of type:name, wildcards supported -x MANIFEST complete path of package.xml file listing components to deploy
  • 14. Testing Code sf apex run test -n CLASSNAME This will run your Apex Test Class (repeat tag for multiple classes) Other Parameters: -c displays code coverage results -l LEVEL without CLASSNAME, specify level -d PATH output results to a directory
  • 15. Testing Code sf apex run test -n CLASSNAME This will run your Apex Test Class (repeat tag for multiple classes) Other Parameters: -c displays code coverage results -l LEVEL without CLASSNAME, specify level -d PATH output results to a directory
  • 16. Testing Code sf force lightning lwc test run -n TESTNAME This will run your Lightning Jest Tests
  • 17. Data CLI commands let you create, get and query data! sf data create record sf data get record sf data query
  • 20. Trailhead on the CLI Modules ● App Development with Salesforce DX ● Command-Line Interface ● Lightning Web Components Basics ● Package Development Model ● Unlocked Packages for Customers
  • 21. Trailhead on the CLI Projects ● Quick Start: Salesforce DX ● Quick Start: Unlocked Packages ● Quick Start: Visual Studio Code for Salesforce Development ● Set Up Your Lightning Web Components Developer Tools ● Quick Start: Lightning Web Components ● Find and Fix Bugs with Apex Replay Debugger ● Build a Bear-Tracking App with Lightning Web Components
  • 22. CLI Documentation ● Salesforce CLI Setup Guide ● Salesforce CLI Command Reference ● Salesforce CLI Plug-in Developers Guide ● Salesforce DX Developer Guide ● Developer Experience ● CLI in the C-L-E: Slides & Hands-on Exercise