SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Downloaden Sie, um offline zu lesen
Intro to Command Line and the Salesforce
Command Line Interface (CLI)
11 September, 2019
Peter Chittum, Developer Evangelist
Kieren Jameson, Director Trailhead Content Engineering
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the
assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we
make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber
growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief,
any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new
products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays
in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the
immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth,
new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger
enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form
10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important
disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Forward-Looking Statement
Statement under the Private Securities Litigation Reform Act of 1995
Intro to Command Line and the Salesforce
Command Line Interface (CLI)
11 September, 2019
Peter Chittum, Developer Evangelist
Kieren Jameson, Director Trailhead Content Engineering
Director, Trailhead Content
Engineering
Salesforce
@kierenjameson
Co-Founder RAD Women
WomenCodeHeroes.com
Kieren Jameson
Today’s Speakers
Developer Evangelist
Salesforce
@pchittum
Peter Chittum
● Introduction
● Command Line Interfaces (CLI) basics with demo
● Intro to Salesforce CLI with demo
● Resources
● Q&A
Today’s Agenda
Introduction
You can still call yourself a developer if you’re not a
command line guru.
Who are you?
Developer
Some experience with developing on Salesforce
Not adopted the command line as a tool
Peter: Developer, started with CLI in the 80s/90s,
embraced GUIs, rediscovered CLI 5 years ago,
“competent” with CLIs
Kieren: Admin who codes, engineering manager, want to
know a little about all-the-things, love dev puzzles, use CLI
for GitHub
We’re just like you...
Introduction to the Command Line
Command line competence
“A command-line interface (CLI) is a means of
interacting with a computer program where the
user...issues commands to the program in the
form of successive lines of text (command lines).
ref. Wikipedia: Command-line Interface
What is the Command-line Interface?
Seriously, though. Text-based UI?
What’s with all the typing? Why would I do that?
Any time you issue a text-based command to an app, this is a form of command-line interface
● Finder (on Mac OS) or Cortana (on Windows 10)
● Browser Address Bar
● Slack, GitHub, Quip (slash commands like /giphy or /invite)
● Google Web Search (“site:” or “exact text”)
● Gmail Search (“label:friends” or “has:attachment”)
Even @mentioning someone in Facebook/LinkedIn/Twitter/Chatter counts!
Fun Fact: You’re (probably) already using a command line
Command Line in your GUI Example: Slack Slash Command
Command Line in your GUI Example: Advanced Searches
Command line versus GUI
HIGHLYNOT VERY
GUI
CLI
Intuitive
Discoverable
Flexible
Batchable
Repeatable
Speedy
Guard rails
There is a Learning Curve, but we think it’s worth it
Learn the Command Line
or
How does the command line work?
COMMAND
STDIN
STDOUTtxt
STDERR
'force.com' sed s/force.com/Lightning/ 'Lightning'
INPUT OUTPUT
or
date --utc
Anatomy of a command
date -u
most parameters
have abbreviations
output: Thu 22 Aug 2019 09:06:30 UTC
command parameter
(or option)
cd
ls
cat, tail, head
grep
sed
Our top 5 commands
Move around your file system
Unix-based
cd
cd ~
cd ..
cd child
cd child/grandchild
cd /
PowerShell
Set-Location [alias: cd]
Set-Location ~
Set-Location ..
Set-Location child
Set-Location childgrandchild
Set-Location C:
Show the contents of a directory
Unix-based
ls
ls
ls -al
PowerShell
Get-ChildItem [alias: ls, dir]
Get-ChildItem
Get-ChildItem -Attributes Hidden
Output text from a file
Unix-based
cat (head, tail)
cat myfile.txt
cat file1.txt file2.txt
head -n 5 myfile.txt
tail -n 5 myfile.txt
PowerShell
Get-Content [alias: cat, gc]
Get-Content -Path myfile.txt
$file2 = Get-Content "file2.txt"
Add-Content "file1.txt" $file2
Get-Content -Path myfile.txt -Head 5
Get-Content -Path myfile.txt -Tail 5
Find matching text in a file
Unix-based
grep
grep 'codey' characters.txt
grep -r 'test[mM]ethod'
force-app/main/default/classes
PowerShell
Select-String [alias: sls]
sls -Pattern 'codey' -Path
characters.txt -SimpleMatch
sls -Pattern 'test[mM]ethod' -Path
force-appmaindefaultclasses
Find and replace text
Unix-based
sed
sed 's/this/that/' file.txt
sed 's/this/that/g' file.txt
sed 's/this/that/I' file.txt
PowerShell
Get-Content with -replace
gc file.txt | %{$_ -replace 'this',
'that'}
(gc file.txt).replace('this', 'that')
Important commands for the “bash family” (Mac, Linux, Unix)
What do you want to do? Command What is stands for Example
Move around the file system cd Change directory cd folder_name/
Show where you currently are pwd Print working directory pwd
Display what’s in a directory ls List ls -al
Make an empty file touch (updates time stamp) touch empty.txt
Create a folder mkdir Make directory mkdr new_folder
Copy a file or folder cp Copy cp myfile1 new_folder/myfile1
Move or rename file or folder mv Move mv myfile1 new_folder/myfile1
Delete this file or folder rm Remove rm -r new_folder
Delete an empty folder rmdir Remove directory rm new_folder
Look for a file with text in it that
matches this pattern
grep Global regular
expression print
grep 'find' here.txt
Find and replace text sed Stream editor sed r/this/that/
Display the contents of files cat Concatenate cat myfile.txt myotherfile.txt
Output text echo (output to stdout) echo text1
Important commands for PowerShell (Windows 7+)
What do you want to do? Command (alias) Example
Move around the file system Set-Location (cd) cd folder_name/
Display where you currently are Get-Location (pwd) pwd
Display what’s in this directory Get-ChildItem (dir) dir
Make an empty shell of a file New-Item New-Item empty.txt
Create a folder New-Item (mkdir) New-Item new_folder -Type Directory
Copy a file or folder Copy-Item (cp) cp new_folder new_folder_2
Move a file or folder Move-Item (mv) mv file1 new_folder/file1
Delete this file or folder Remove-Item (del) del folder_or_name
Find and replace text .replace (gc file.txt).replace('this',
'that')
Look for a file with text in it that
matches this pattern
Select-String (sls) sls "find" here.txt
Display the contents of a file Get-Content Get-Content myfile.txt
Output text somewhere Write-Output Write-Output "text1"
Semicolon: Do the first command; then do another one
;
cd / ; ls
Pipe: Send output from the first command to the second
|
cat bigFile.txt | less
Note: Type “q” to exit out of this
(Careful…this wipes the previous contents of the file)
Redirect: Write output from first command to a file
>
echo "text1" > myFile.txt
References: Echo Commands in Linux with Examples
Append: Write output from first command to the end of a file
>>
echo "text2" >> myFile.txt
Important Operators
What do you want to do? Operator Aka Example
Pass output to the next command | Pipe cat names.txt|sort
Write output to a new file > Redirect echo "text1" > myFile.txt
Append output on the end of a file >> Append echo "text2" >> myFile.txt
Strings commands together ; cd;pwd
Use this key... ...to do this
Tab Auto-complete what you’ve started typing
Ctrl-c (CTRL even on Mac) Stop a process that’s not ending on its own
⬆ and ⬇ move through the history of your typed commands
Important Features (of most command line interfaces)
Command Line “Recipes”
Recipe What does it do?
ls -la > files.txt
Shows all files in a directory
cd;pwd gets you to your home directory, shows you
grep "old" file.csv | sed s/old/new/ >
cleaned.csv
Looks for lines with “old” in file.csv, replaces it with
“new”, and creates a new file cleaned.csv
grep -E
"b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[
A-Za-z]{2,6}b"
Looks for wonky emails
(found on the internet!)
head -n 1 file1 | cat - file2 > file3 Gets the first line of file1, concatenates it to the top
of file2, creates a new file3
Demo Scenario: Basics of CLI
Let’s take these commands out for a spin.
On the way we’ll show you how to create a new and improved forward
looking statement.
Demo Time!
Data Management with Command Line
(Free yourself from Excel)
Live Demo
Using Basic Command Line Features
Using the Salesforce CLI
For everyone
Modern Application Lifecycle Management
Plan
Code
BuildTest
Release
CLI for integration with 3rd
party editors
Development Environments:
Scratch Orgs & Dev Sandboxes
Lightning Dev Pro Sandboxes
Continuous Delivery/ build
automation
Continuous integration with
test automation
Test Environments
Partial & Full Sandboxes
for UAT, staging
Packaging
Source Control
Repository
IDEs, Text Editors,
Language Services
Org Development
BETA
Buffet, not Fixed Menu
Salesforce CLI
Connect your laptop to any org
Access common Salesforce APIs
Universal: same on Windows or Mac
Pluggable
Use community-built plugins
Write custom plugins
Not the “Salesforce DX” CLI
Check Out Shane McLaughlin's Directory of Awesome CLI Plugins
SFDX in Action!
Live Demo
How a Salesforce CLI Command Works
Windows, Mac, and Linux support
Salesforce CLI
Action to take
(Plugin)
Parameters
sfdx force:data:record:get -s Contact -w Email=jane@some.com –u UserAlias
Useful Salesforce CLI parameter
Reference: Salesforce CLI Command Reference
Parameter What does it do?
-h get help for a command
-u define the user (and org) for executing the command
-s which SObject (with data) or set default user (with auth)
-a define an alias
-f reference a file path
-i define the external ID
--json set the output format to be JSON
What the Salesforce CLI Can Do
Apex (logs, execute, test)
Authorization (OAuth, login)
Data Management
Lightning (lint, test)
Packaging
Limits (API, Reports, etc)
Org (create, delete, open)
Schema (list, describe)
User (assign perm sets)
Salesforce CLI Command Reference
Today’s Buffet
• Org management
• Data management
• User management
• Sandbox management
• Limits
• Scheduling
• Apex log tail
• Apex “scripting” (Execute Anonymous)
Output Apex Log Locally
sfdx force:apex:log:tail -c
Execute Some Apex
sfdx force:apex:execute -f FileWithApex.txt
Get Org Limits
sfdx force:limits:api:display | grep 'api'
SFDX Command Line Recipes
Clone a sandbox with a definition file
sfdx force:org:clone -t sandbox -f
config/dev-sandbox-def.json -u prodOrg -a
AliasForNewSandox -s -w 20
Clone a sandbox without a definition file
SourceSandboxName=SandboxToClone
SandboxName=NewSandbox -a AliasForNewSandbox -t
sandbox -s -u devhub -w 20
List all Sandboxes
sfdx force:data:soql:query -t -q 'SELECT
SanboxName, LicenseType FROM SandboxInfo'
Refresh a Sandbox
Summary & Resources
Summary
● Anyone can use a Command Line Interface
● Productivity comes with practice
● Salesforce CLI for Salesforce developer productivity
Trailhead Resources
If you’re doing team development with
multiple admins or a mixture of admins and
devs...
If you want to dip your toe in the water...
Quick Start: Salesforce DX
Look out for more
content at DF19
App Development
with Salesforce DX
Git & GitHub Basics
Resources for Learning CLI
General CLI Resources
● Command Line for Beginners
● PowerShell Utility Reference
● List of Command LIne Commands
Salesforce CLI Specific Resources
● Salesforce CLI Command Reference
● TrailheaDX Talk: If You Can Write a Salesforce
Formula, You Can Use the Command Line
● TrailheaDX Talk: Apply the Salesforce CLI to
Everyday Problems
● Batch Examples in everyday-cli git repo
Developer webinar: Intro to command lines and the salesforce CLI
Developer webinar: Intro to command lines and the salesforce CLI
Developer webinar: Intro to command lines and the salesforce CLI

Weitere ähnliche Inhalte

Was ist angesagt?

Simplify your code with Salesforce DX and module development
Simplify your code with Salesforce DX and module developmentSimplify your code with Salesforce DX and module development
Simplify your code with Salesforce DX and module developmentSalesforce Developers
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceDoug Ayers
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce Developers
 
TDX19 - Untangle Your Org with Salesforce Developer Tools
TDX19 - Untangle Your Org with Salesforce Developer ToolsTDX19 - Untangle Your Org with Salesforce Developer Tools
TDX19 - Untangle Your Org with Salesforce Developer ToolsDoug Ayers
 
Design patterns for salesforce app decomposition
Design patterns for salesforce app decompositionDesign patterns for salesforce app decomposition
Design patterns for salesforce app decompositionSai Jithesh ☁️
 
Salesforce DX 201 - Advanced Implementation for ISVs
Salesforce DX 201 - Advanced Implementation for ISVsSalesforce DX 201 - Advanced Implementation for ISVs
Salesforce DX 201 - Advanced Implementation for ISVsVivek Chawla
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersJohn Stevenson
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersSalesforce Developers
 
Dreamforce 2017: Salesforce DX - an Admin's Perspective
Dreamforce 2017:  Salesforce DX - an Admin's PerspectiveDreamforce 2017:  Salesforce DX - an Admin's Perspective
Dreamforce 2017: Salesforce DX - an Admin's PerspectiveMike White
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Avivsready
 
Team Development on Force.com with Github and Ant
Team Development on Force.com with Github and AntTeam Development on Force.com with Github and Ant
Team Development on Force.com with Github and AntSalesforce Developers
 
How Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comHow Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comSalesforce Engineering
 
Best Practices for Successful Deployment
Best Practices for Successful DeploymentBest Practices for Successful Deployment
Best Practices for Successful DeploymentSalesforce Developers
 
Dependency Injection with the Force DI Framework
Dependency Injection with the Force DI FrameworkDependency Injection with the Force DI Framework
Dependency Injection with the Force DI FrameworkDoug Ayers
 
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...Vivek Chawla
 
Scaling Continuous Integration for Puppet
Scaling Continuous Integration for PuppetScaling Continuous Integration for Puppet
Scaling Continuous Integration for PuppetSalesforce Engineering
 
Streamline Selenium Testing with Page Flow Navigation
Streamline Selenium Testing with Page Flow NavigationStreamline Selenium Testing with Page Flow Navigation
Streamline Selenium Testing with Page Flow NavigationSalesforce Developers
 
Automating the Impossible: End to End Team Development for ISVs (October 14, ...
Automating the Impossible: End to End Team Development for ISVs (October 14, ...Automating the Impossible: End to End Team Development for ISVs (October 14, ...
Automating the Impossible: End to End Team Development for ISVs (October 14, ...Salesforce Partners
 
sf tools from community
sf tools from communitysf tools from community
sf tools from communityDurgesh Dhoot
 
The Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleThe Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleJoshua Hoskins
 

Was ist angesagt? (20)

Simplify your code with Salesforce DX and module development
Simplify your code with Salesforce DX and module developmentSimplify your code with Salesforce DX and module development
Simplify your code with Salesforce DX and module development
 
TDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and SalesforceTDX19 - Accelerate DevOps with GitLab and Salesforce
TDX19 - Accelerate DevOps with GitLab and Salesforce
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep Dive
 
TDX19 - Untangle Your Org with Salesforce Developer Tools
TDX19 - Untangle Your Org with Salesforce Developer ToolsTDX19 - Untangle Your Org with Salesforce Developer Tools
TDX19 - Untangle Your Org with Salesforce Developer Tools
 
Design patterns for salesforce app decomposition
Design patterns for salesforce app decompositionDesign patterns for salesforce app decomposition
Design patterns for salesforce app decomposition
 
Salesforce DX 201 - Advanced Implementation for ISVs
Salesforce DX 201 - Advanced Implementation for ISVsSalesforce DX 201 - Advanced Implementation for ISVs
Salesforce DX 201 - Advanced Implementation for ISVs
 
Dreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developersDreamforce 13 developer session: Git for Force.com developers
Dreamforce 13 developer session: Git for Force.com developers
 
Introduction to Git for Force.com Developers
Introduction to Git for Force.com DevelopersIntroduction to Git for Force.com Developers
Introduction to Git for Force.com Developers
 
Dreamforce 2017: Salesforce DX - an Admin's Perspective
Dreamforce 2017:  Salesforce DX - an Admin's PerspectiveDreamforce 2017:  Salesforce DX - an Admin's Perspective
Dreamforce 2017: Salesforce DX - an Admin's Perspective
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Aviv
 
Team Development on Force.com with Github and Ant
Team Development on Force.com with Github and AntTeam Development on Force.com with Github and Ant
Team Development on Force.com with Github and Ant
 
How Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.comHow Open Source Embiggens Salesforce.com
How Open Source Embiggens Salesforce.com
 
Best Practices for Successful Deployment
Best Practices for Successful DeploymentBest Practices for Successful Deployment
Best Practices for Successful Deployment
 
Dependency Injection with the Force DI Framework
Dependency Injection with the Force DI FrameworkDependency Injection with the Force DI Framework
Dependency Injection with the Force DI Framework
 
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
 
Scaling Continuous Integration for Puppet
Scaling Continuous Integration for PuppetScaling Continuous Integration for Puppet
Scaling Continuous Integration for Puppet
 
Streamline Selenium Testing with Page Flow Navigation
Streamline Selenium Testing with Page Flow NavigationStreamline Selenium Testing with Page Flow Navigation
Streamline Selenium Testing with Page Flow Navigation
 
Automating the Impossible: End to End Team Development for ISVs (October 14, ...
Automating the Impossible: End to End Team Development for ISVs (October 14, ...Automating the Impossible: End to End Team Development for ISVs (October 14, ...
Automating the Impossible: End to End Team Development for ISVs (October 14, ...
 
sf tools from community
sf tools from communitysf tools from community
sf tools from community
 
The Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development LifecycleThe Ideal Salesforce Development Lifecycle
The Ideal Salesforce Development Lifecycle
 

Ähnlich wie Developer webinar: Intro to command lines and the salesforce CLI

Intro to the Salesforce Command Line Interface for Admins
Intro to the Salesforce Command Line Interface for AdminsIntro to the Salesforce Command Line Interface for Admins
Intro to the Salesforce Command Line Interface for AdminsSalesforce Admins
 
Do Not Fear the Command Line
Do Not Fear the Command LineDo Not Fear the Command Line
Do Not Fear the Command LinePeter Chittum
 
Don't Fear the Command Line
Don't Fear the Command LineDon't Fear the Command Line
Don't Fear the Command LinePeter Chittum
 
If You Can Write a Salesforce Formula, You Can Use the Command Line
If You Can Write a Salesforce Formula, You Can Use the Command LineIf You Can Write a Salesforce Formula, You Can Use the Command Line
If You Can Write a Salesforce Formula, You Can Use the Command LinePeter Chittum
 
Software Build processes and Git
Software Build processes and GitSoftware Build processes and Git
Software Build processes and GitAlec Clews
 
Berry 10 years_of_dita
Berry 10 years_of_ditaBerry 10 years_of_dita
Berry 10 years_of_ditaMysti Berry
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Microsoft TechNet
 
Salesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeSalesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeThierry TROUIN ☁
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...Joe Ferguson
 
Lap around .net 4
Lap around .net 4Lap around .net 4
Lap around .net 4Abdul Khan
 
Connect Your Clouds with Force.com
Connect Your Clouds with Force.comConnect Your Clouds with Force.com
Connect Your Clouds with Force.comJeff Douglas
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
 
Advanced PowerShell Automation
Advanced PowerShell AutomationAdvanced PowerShell Automation
Advanced PowerShell Automationkieranjacobsen
 
Framework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users GroupFramework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users Groupbrada
 
MWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To YouMWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To YouPeter Presnell
 

Ähnlich wie Developer webinar: Intro to command lines and the salesforce CLI (20)

Intro to the Salesforce Command Line Interface for Admins
Intro to the Salesforce Command Line Interface for AdminsIntro to the Salesforce Command Line Interface for Admins
Intro to the Salesforce Command Line Interface for Admins
 
Do Not Fear the Command Line
Do Not Fear the Command LineDo Not Fear the Command Line
Do Not Fear the Command Line
 
Don't Fear the Command Line
Don't Fear the Command LineDon't Fear the Command Line
Don't Fear the Command Line
 
If You Can Write a Salesforce Formula, You Can Use the Command Line
If You Can Write a Salesforce Formula, You Can Use the Command LineIf You Can Write a Salesforce Formula, You Can Use the Command Line
If You Can Write a Salesforce Formula, You Can Use the Command Line
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
 
Software Build processes and Git
Software Build processes and GitSoftware Build processes and Git
Software Build processes and Git
 
Berry 10 years_of_dita
Berry 10 years_of_ditaBerry 10 years_of_dita
Berry 10 years_of_dita
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
Automating Desktop Management with Windows Powershell V2.0 and Group Policy M...
 
Salesforce DX with Visual Studio Code
Salesforce DX with Visual Studio CodeSalesforce DX with Visual Studio Code
Salesforce DX with Visual Studio Code
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...
 
Lap around .net 4
Lap around .net 4Lap around .net 4
Lap around .net 4
 
Connect Your Clouds with Force.com
Connect Your Clouds with Force.comConnect Your Clouds with Force.com
Connect Your Clouds with Force.com
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 
Windows PowerShell
Windows PowerShellWindows PowerShell
Windows PowerShell
 
Advanced PowerShell Automation
Advanced PowerShell AutomationAdvanced PowerShell Automation
Advanced PowerShell Automation
 
Framework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users GroupFramework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users Group
 
MWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To YouMWLUG 2014: ATLUG Comes To You
MWLUG 2014: ATLUG Comes To You
 

Kürzlich hochgeladen

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Developer webinar: Intro to command lines and the salesforce CLI

  • 1. Intro to Command Line and the Salesforce Command Line Interface (CLI) 11 September, 2019 Peter Chittum, Developer Evangelist Kieren Jameson, Director Trailhead Content Engineering
  • 2.
  • 3.
  • 4. This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Forward-Looking Statement Statement under the Private Securities Litigation Reform Act of 1995
  • 5. Intro to Command Line and the Salesforce Command Line Interface (CLI) 11 September, 2019 Peter Chittum, Developer Evangelist Kieren Jameson, Director Trailhead Content Engineering
  • 6. Director, Trailhead Content Engineering Salesforce @kierenjameson Co-Founder RAD Women WomenCodeHeroes.com Kieren Jameson Today’s Speakers Developer Evangelist Salesforce @pchittum Peter Chittum
  • 7. ● Introduction ● Command Line Interfaces (CLI) basics with demo ● Intro to Salesforce CLI with demo ● Resources ● Q&A Today’s Agenda
  • 8. Introduction You can still call yourself a developer if you’re not a command line guru.
  • 9. Who are you? Developer Some experience with developing on Salesforce Not adopted the command line as a tool
  • 10. Peter: Developer, started with CLI in the 80s/90s, embraced GUIs, rediscovered CLI 5 years ago, “competent” with CLIs Kieren: Admin who codes, engineering manager, want to know a little about all-the-things, love dev puzzles, use CLI for GitHub We’re just like you...
  • 11. Introduction to the Command Line Command line competence
  • 12. “A command-line interface (CLI) is a means of interacting with a computer program where the user...issues commands to the program in the form of successive lines of text (command lines). ref. Wikipedia: Command-line Interface What is the Command-line Interface?
  • 13. Seriously, though. Text-based UI? What’s with all the typing? Why would I do that?
  • 14. Any time you issue a text-based command to an app, this is a form of command-line interface ● Finder (on Mac OS) or Cortana (on Windows 10) ● Browser Address Bar ● Slack, GitHub, Quip (slash commands like /giphy or /invite) ● Google Web Search (“site:” or “exact text”) ● Gmail Search (“label:friends” or “has:attachment”) Even @mentioning someone in Facebook/LinkedIn/Twitter/Chatter counts! Fun Fact: You’re (probably) already using a command line
  • 15. Command Line in your GUI Example: Slack Slash Command
  • 16. Command Line in your GUI Example: Advanced Searches
  • 17. Command line versus GUI HIGHLYNOT VERY GUI CLI Intuitive Discoverable Flexible Batchable Repeatable Speedy Guard rails
  • 18. There is a Learning Curve, but we think it’s worth it
  • 20. or How does the command line work? COMMAND STDIN STDOUTtxt STDERR 'force.com' sed s/force.com/Lightning/ 'Lightning' INPUT OUTPUT or
  • 21. date --utc Anatomy of a command date -u most parameters have abbreviations output: Thu 22 Aug 2019 09:06:30 UTC command parameter (or option)
  • 23. Move around your file system Unix-based cd cd ~ cd .. cd child cd child/grandchild cd / PowerShell Set-Location [alias: cd] Set-Location ~ Set-Location .. Set-Location child Set-Location childgrandchild Set-Location C:
  • 24. Show the contents of a directory Unix-based ls ls ls -al PowerShell Get-ChildItem [alias: ls, dir] Get-ChildItem Get-ChildItem -Attributes Hidden
  • 25. Output text from a file Unix-based cat (head, tail) cat myfile.txt cat file1.txt file2.txt head -n 5 myfile.txt tail -n 5 myfile.txt PowerShell Get-Content [alias: cat, gc] Get-Content -Path myfile.txt $file2 = Get-Content "file2.txt" Add-Content "file1.txt" $file2 Get-Content -Path myfile.txt -Head 5 Get-Content -Path myfile.txt -Tail 5
  • 26. Find matching text in a file Unix-based grep grep 'codey' characters.txt grep -r 'test[mM]ethod' force-app/main/default/classes PowerShell Select-String [alias: sls] sls -Pattern 'codey' -Path characters.txt -SimpleMatch sls -Pattern 'test[mM]ethod' -Path force-appmaindefaultclasses
  • 27. Find and replace text Unix-based sed sed 's/this/that/' file.txt sed 's/this/that/g' file.txt sed 's/this/that/I' file.txt PowerShell Get-Content with -replace gc file.txt | %{$_ -replace 'this', 'that'} (gc file.txt).replace('this', 'that')
  • 28. Important commands for the “bash family” (Mac, Linux, Unix) What do you want to do? Command What is stands for Example Move around the file system cd Change directory cd folder_name/ Show where you currently are pwd Print working directory pwd Display what’s in a directory ls List ls -al Make an empty file touch (updates time stamp) touch empty.txt Create a folder mkdir Make directory mkdr new_folder Copy a file or folder cp Copy cp myfile1 new_folder/myfile1 Move or rename file or folder mv Move mv myfile1 new_folder/myfile1 Delete this file or folder rm Remove rm -r new_folder Delete an empty folder rmdir Remove directory rm new_folder Look for a file with text in it that matches this pattern grep Global regular expression print grep 'find' here.txt Find and replace text sed Stream editor sed r/this/that/ Display the contents of files cat Concatenate cat myfile.txt myotherfile.txt Output text echo (output to stdout) echo text1
  • 29. Important commands for PowerShell (Windows 7+) What do you want to do? Command (alias) Example Move around the file system Set-Location (cd) cd folder_name/ Display where you currently are Get-Location (pwd) pwd Display what’s in this directory Get-ChildItem (dir) dir Make an empty shell of a file New-Item New-Item empty.txt Create a folder New-Item (mkdir) New-Item new_folder -Type Directory Copy a file or folder Copy-Item (cp) cp new_folder new_folder_2 Move a file or folder Move-Item (mv) mv file1 new_folder/file1 Delete this file or folder Remove-Item (del) del folder_or_name Find and replace text .replace (gc file.txt).replace('this', 'that') Look for a file with text in it that matches this pattern Select-String (sls) sls "find" here.txt Display the contents of a file Get-Content Get-Content myfile.txt Output text somewhere Write-Output Write-Output "text1"
  • 30. Semicolon: Do the first command; then do another one ; cd / ; ls
  • 31. Pipe: Send output from the first command to the second | cat bigFile.txt | less Note: Type “q” to exit out of this
  • 32. (Careful…this wipes the previous contents of the file) Redirect: Write output from first command to a file > echo "text1" > myFile.txt References: Echo Commands in Linux with Examples
  • 33. Append: Write output from first command to the end of a file >> echo "text2" >> myFile.txt
  • 34. Important Operators What do you want to do? Operator Aka Example Pass output to the next command | Pipe cat names.txt|sort Write output to a new file > Redirect echo "text1" > myFile.txt Append output on the end of a file >> Append echo "text2" >> myFile.txt Strings commands together ; cd;pwd Use this key... ...to do this Tab Auto-complete what you’ve started typing Ctrl-c (CTRL even on Mac) Stop a process that’s not ending on its own ⬆ and ⬇ move through the history of your typed commands Important Features (of most command line interfaces)
  • 35. Command Line “Recipes” Recipe What does it do? ls -la > files.txt Shows all files in a directory cd;pwd gets you to your home directory, shows you grep "old" file.csv | sed s/old/new/ > cleaned.csv Looks for lines with “old” in file.csv, replaces it with “new”, and creates a new file cleaned.csv grep -E "b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[ A-Za-z]{2,6}b" Looks for wonky emails (found on the internet!) head -n 1 file1 | cat - file2 > file3 Gets the first line of file1, concatenates it to the top of file2, creates a new file3
  • 36. Demo Scenario: Basics of CLI Let’s take these commands out for a spin. On the way we’ll show you how to create a new and improved forward looking statement.
  • 37. Demo Time! Data Management with Command Line (Free yourself from Excel)
  • 38. Live Demo Using Basic Command Line Features
  • 40.
  • 41.
  • 42. For everyone Modern Application Lifecycle Management Plan Code BuildTest Release CLI for integration with 3rd party editors Development Environments: Scratch Orgs & Dev Sandboxes Lightning Dev Pro Sandboxes Continuous Delivery/ build automation Continuous integration with test automation Test Environments Partial & Full Sandboxes for UAT, staging Packaging Source Control Repository IDEs, Text Editors, Language Services Org Development BETA
  • 44. Salesforce CLI Connect your laptop to any org Access common Salesforce APIs Universal: same on Windows or Mac Pluggable Use community-built plugins Write custom plugins Not the “Salesforce DX” CLI Check Out Shane McLaughlin's Directory of Awesome CLI Plugins
  • 46. How a Salesforce CLI Command Works Windows, Mac, and Linux support Salesforce CLI Action to take (Plugin) Parameters sfdx force:data:record:get -s Contact -w Email=jane@some.com –u UserAlias
  • 47. Useful Salesforce CLI parameter Reference: Salesforce CLI Command Reference Parameter What does it do? -h get help for a command -u define the user (and org) for executing the command -s which SObject (with data) or set default user (with auth) -a define an alias -f reference a file path -i define the external ID --json set the output format to be JSON
  • 48. What the Salesforce CLI Can Do Apex (logs, execute, test) Authorization (OAuth, login) Data Management Lightning (lint, test) Packaging Limits (API, Reports, etc) Org (create, delete, open) Schema (list, describe) User (assign perm sets) Salesforce CLI Command Reference
  • 49. Today’s Buffet • Org management • Data management • User management • Sandbox management • Limits • Scheduling • Apex log tail • Apex “scripting” (Execute Anonymous)
  • 50. Output Apex Log Locally sfdx force:apex:log:tail -c Execute Some Apex sfdx force:apex:execute -f FileWithApex.txt Get Org Limits sfdx force:limits:api:display | grep 'api' SFDX Command Line Recipes Clone a sandbox with a definition file sfdx force:org:clone -t sandbox -f config/dev-sandbox-def.json -u prodOrg -a AliasForNewSandox -s -w 20 Clone a sandbox without a definition file SourceSandboxName=SandboxToClone SandboxName=NewSandbox -a AliasForNewSandbox -t sandbox -s -u devhub -w 20 List all Sandboxes sfdx force:data:soql:query -t -q 'SELECT SanboxName, LicenseType FROM SandboxInfo' Refresh a Sandbox
  • 52. Summary ● Anyone can use a Command Line Interface ● Productivity comes with practice ● Salesforce CLI for Salesforce developer productivity
  • 53. Trailhead Resources If you’re doing team development with multiple admins or a mixture of admins and devs... If you want to dip your toe in the water... Quick Start: Salesforce DX Look out for more content at DF19 App Development with Salesforce DX Git & GitHub Basics
  • 54. Resources for Learning CLI General CLI Resources ● Command Line for Beginners ● PowerShell Utility Reference ● List of Command LIne Commands Salesforce CLI Specific Resources ● Salesforce CLI Command Reference ● TrailheaDX Talk: If You Can Write a Salesforce Formula, You Can Use the Command Line ● TrailheaDX Talk: Apply the Salesforce CLI to Everyday Problems ● Batch Examples in everyday-cli git repo