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.
- Visit https://developer.salesforce.com/tools/sfdxcli to install the CLI.
- Run the following command from the command line to make sure the CLI is correctly installed and is running the most recent version.
The output should read “sfdx-cli: Updating CLI…”
Enter the Dev Hub.
Let’s access your Dev Hub-enabled organization.
- 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:
- 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.
- Click Allow.
Image Source: Trailhead by Salesforce - Your Dev Hub credentials are stored in the CLI when you log in via the browser. In the terminal, you see something resembling this:
Conclusion
In this way, you can use the above commands to use sfdx to authorize the org.
Additional Resources
- Trailhead by Salesforce: Set Up Salesforce DX Tools
- Deployment Strategy and Best Practices
Cover Photo by Compare Fibre on Unsplash