Friday, August 23, 2019

SFDX CLI Command To LogIn to An Org

If you want to login to your developer org/sandbox using the Salesforce CLI please use the below the command.

sfdx force:auth:web:login -a <aliasNameOfYourOrg> -d

sfdx force:auth:web:login -a mergedDev -d

-d   -- Makes this org as default for subsequent commands
-a   -- Alias name that you give for an org to identify prod/sandbox or which sandbox

Once you execute this command you can see this alias name under sfdx-config.json file.Based on the org you (dev or devhub) used it will stores the alias name under the this.


{
    "defaultusername": "mergedDev"}
-------------In case of devhub login------------
{
    "defaultdevhugusername": "mergedDev"}



Hope this helped you..Enjoy!..

No comments: