May 14, 2020
- To authorize a DevHub (i used mydeveloper sandbox)
- sfdx force:auth:web:login -d -a DevHub
- Adding the -d flag sets this org as the default Dev Hub. Use the -a to set an alias for the org (something catchy like DevHub). An alias is much easier to remember than the unique Dev Hub username.
- Only indicate the -d flag for your Dev Hub. If you use it with a different org, you can’t create scratch orgs until you correctly identify the Dev Hub using the config:set command.
- if you want to open the Dev Hub org to look at active scratch orgs or your namespace registry, the alias comes in quite handy:
- sfdx force:org:open -u DevHub
- It’s likely you have many orgs, including sandboxes and your production org. With the CLI, you can also log in to them using these commands. When you log in to an org using the CLI, you add that org to the list of orgs that the CLI can work with in the future.
- sfdx force:auth:web:login -r https://test.salesforce.com -a FullSandbox
- Aliasing is powerful as it is difficult to remember complex usernames especially for scratch org.
- View all orgs : sfdx force:org:list