Setting up SFDX

By in
577
Setting up SFDX

A suite of tools called the Salesforce Developer Experience (SFDX) optimizes the whole development life cycle. It enhances team development and cooperation, makes automated testing and continuous integration easier, and accelerates and streamlines the release cycle.

 

Scratch Org

You can utilize a new kind of org called a scratch org thanks in large part to the configuration you perform for Salesforce DX. When beginning a new project, feature branch, or feature test, you can easily set up a dedicated, customizable, short-term Salesforce environment called a “scratch org.”

 

Developer Hub

The primary Salesforce org that you and your team utilize to build and maintain your scratch orgs is called a Developer Hub (Dev Hub).

Activate the Command Line Interface (CLI)

To manage the whole application life cycle of your Salesforce apps, use the Salesforce CLI. It makes it simple to setup environments for testing and development, sync source code between your orgs and VCS, and run tests.

 

  1. Visit https://developer.salesforce.com/tools/sfdxcli to install the CLI.
  2. Run the following command from the command line to make sure the CLI is correctly installed and is running the most recent version.                                                                         sfdx

The output should read “sfdx-cli: Updating CLI…”

Enter the Dev Hub.

Let’s access your Dev Hub-enabled organization.

  1. Using the options -a and -d, you can alias DevHub and set it as the default organization. Enter the web login flow in the command window to authorize the Dev Hub. The web browser’s Salesforce login page is opened with the following command: sfdx
  2. Enter your Dev Hub org login information. Please be aware that this org is exclusive to Salesforce DX. For this project, a Dev Hub enabled org is required.
  3. Click Allow.

    SFDX Salesforce Developer Experience
    Image Source: Trailhead by Salesforce
  4. Your Dev Hub credentials are stored in the CLI when you log in via the browser. In the terminal, you see something resembling this: develop

 

Conclusion

In this way, you can use the above commands to use sfdx to authorize the org.

 

Additional Resources

Cover Photo by Compare Fibre on Unsplash

Leave a reply

Your email address will not be published. Required fields are marked *