do not fear the command linedreamole.es/wp-content/uploads/2017/06/donotfearthecommandli… · do...

54
Do Not Fear the Command Line You're Smarter than It Madrid 1st June 2017

Upload: others

Post on 29-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Do Not Fear the Command LineYou're Smarter than It

Madrid 1st June 2017

Page 2: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Do Not Fear the Command LineYou Are Smarter Than It

Peter Chittum, Developer Evangelist@pchittum

Page 3: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Forward-Looking Statements

Statement under the Private Securities Litigation Reform Act of 1995:

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.

Page 4: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Any Computer User You Want To Use Command Line You Are Not Sure Where to Start

Who are you?

Page 5: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Not an exhaustive "How To"How command line apps workUnderstand what you can doA Small Taste of Salesforce DX

What to Expect

Page 6: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

I'm using a Mac

Page 7: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Overview of Command LinesHow Commands WorkMore Powerful StuffSalesforce CLIsWhere To Go Next (git, npm, brew, grep)

Page 8: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

A Brief History of User Interfaces

Page 9: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

This is my laptop. There are many like it, but this one is mine.

Page 10: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Pros

Pros and Cons of Command Lines

Low Resource UsageConcise and PowerfulExpert FriendlyAutomate with Scripting

Cons

UnintuitiveCommands not ObviousNot Visually RichBeginner Unfriendly

Page 11: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

A few obvious statements follow…

Page 12: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

The command line is an app

Page 13: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

The command line executes commands

Page 14: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Commands are little appsYou write them instead of clicking on them.

Page 15: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Overview of Command LinesHow Commands WorkMore Powerful StuffSalesforce CLIsWhere To Go Next

Page 16: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

How a command works

Input(STDIN,

FILE)

Output(STDOUT

)

Page 17: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

How a command works

Input(STDIN,

FILE)

Output(STDOUT

)

Add something here about STDERR

Page 18: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Sound familiar?

0013000000rqYCC

CASESAFEID()

0013000000rqYCCAA2

Page 19: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

There are also parameters

Input Output

Parameters

Page 20: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Semicolon: Do one thing ; then do another

;

Page 21: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Only do the seccond if the first one works correctly

&&

Page 22: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Pipe: Take the output from the first thing and send it to the second

|

Page 23: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Redirect: Take the output from the first thing and write to a file(Careful…this wipes the previous contents of the file)

>

Page 24: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Append: Take the output from the first thing and write to the end of a file

>>

Page 25: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

bash (Windows 10)cygwincmdpowershell

What if I'm using Windows?

Page 26: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

DemoFiles, Folders, Input, Output

Page 27: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Overview of Command LinesHow Commands WorkMore Powerful StuffSalesforce CLIsWhere To Go Next

Page 28: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

aliasCreate a shortcut for a more complicated command

Page 29: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

cat, head, tailMeow…Just kidding...different ways to read a file

Page 30: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

dogJust kidding…there is no dog...unless you make an alias called "dog"

Then dog does whatever you tell it to do…

...good dog

Page 31: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

wcNot the loo…word countcounts stuff

Page 32: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

findLook for files

Page 33: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

grepSearch in files(global regular expression print)

Page 34: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

sedModify data in a stream(stream editor)

Page 35: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

awkBasic programming language for Unix systems(not an acronym, and not covering today…)

Page 36: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

curlWeb request

(Windows has iwr)

Page 37: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Democat, head, tail, wc, grep, sed

Page 38: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Overview of Command LinesHow Commands WorkMore Powerful StuffSalesforce CLIsWhere To Go Next

Page 39: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

> curl https://blixtar-dev-ed.my.salesforce.com/services/data/v39.0/query?q=SELECT+Id,Name+FROM+Account+LIMIT+1 -H 'Authorization: Bearer 00D24000000IwtW!AQ4AQMiGG9NfUlO5njwZpODWCazHSUFRgM26olREehLfu9GPqq1JWSTxwUfgncjdET.13_G0dPm5SobOPuj_F0.vvlU9Ih44'

{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v39.0/sobjects/Account/001240000050EByAAM"},"Id":"001240000050EByAAM","Name":"DVLA"}]}

The trouble with curl

Page 40: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Salesforce DX CLICLI for accessing Salesforce APIs

Currently in Pilot

Page 41: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

force-cliOpen source CLI project

To be superseded by Salesforce DX CLI

Page 42: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Lightning CLIStatic Code Analysis for Lightning Components

Page 43: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Heroku CLIFormerly Heroku toolbelt

Now a part of Salesforce DX CLI

Page 44: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

DemoFiles, Folders, Input, Output

Page 45: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Overview of Command LinesHow Commands WorkMore Powerful StuffSalesforce CLIsWhere To Go Next

Page 46: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Windows is case insensitiveUnix file permissionssudo versus Run As Administrator

Mac/Unix v Windows

Page 47: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Powershell, CMD, cygwin (Windows shells)Z shell (popular powerful Unix shell)Package managers (brew, chocolatey, npm)Automating (cron, shell scripts)Source Control (git)Task Runners (gulp, grunt, …)awk (Unix programming language)REPLs (interactive mode programming)

All the other stuff

Page 48: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Brief History of Command Lineshttp://bit.ly/brief-history-cmd-lines

Windows and Unix Command Line Equivalents: http://bit.ly/win2unixcmd

Page 49: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

My Stuff:

slideshare.net/chittum

salesforce.quip.com/rFA0Af9rhUza

Page 50: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Q & AMadrid 1st June 2017

Page 51: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

?Questions?

Page 52: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Thank Y u

Page 53: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Q & ARemember to tell us what you think in the event survey www.LondonsCalling.net/survey/

Peter ChittumDeveloper [email protected]@pchittum

Page 54: Do Not Fear the Command Linedreamole.es/wp-content/uploads/2017/06/DoNotFearTheCommandLi… · Do Not Fear the Command Line You Are Smarter Than It Peter Chittum, Developer Evangelist

Thank You

Peter ChittumDeveloper Evangelist

[email protected]@pchittum

Remember to tell us what you think in the event survey www.LondonsCalling.net/survey/