Connect the CLI to Your Packaging Org

In this exercise, you will…

  • Authenticate the CLI to your Packaging Org

Authenticate the CLI to your Packaging Org

Important: The command you’re going to use to authenticate your Packaging Org does not have the -d (--defaultdevhubusername) flag. You should only set that flag when connecting to a Developer Hub, and not for regular orgs like your Packaging Org.

Execute this command:

sfdx force:auth:web:login -a PkgOrg
Salesforce DX Command / Flags Description
force:auth:web:login Authorizes a Salesforce org by opening a browser so you can log in through salesforce.com.
-a (--setalias) Sets an alias for the authenticated org.

Log in to your Packaging Org the same way you did for your Dev Hub…

The steps here are exactly the same as when you authenticated your Dev Hub org, only in this case you’ll be logging into Salesforce using your Packaging Org username so the Salesforce CLI Connected App can access it.

After logging into your Packaging Org, your terminal should look something like this:

Updated: