auth commands

The first thing you will need to do is to connect the CLI to Salesforce. The CLI provides commands to connect using web-based OAuth flow, JWT token-based flow, and an sfdx auth URL.

Use JWT-based flow for CI. If you are using Salesforce DX with Travis, Circle, or Jenkins, then it's always recommended to use JWT-based flow.

To connect the Dev Hub to the CLI, run the following command:

sfdx force:auth:web:login -r https://login.Salesforce.com
For Sandbox Orgs, use test.Salesforce.com instead.

The following screenshot shows the Terminal once the CLI has been authorized to connect to Salesforce:

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.