If I missed the -d option when using sfdx force:auth:web:login, is there a way to reset it as default devhub afterwards? I searched through the document but didn't see any.

2 Answers 2


You can use sf config set [email protected]. You can use the additional -g parameter if you want to set it globally.

The related doc is here, in addition to using sf config set -h.

You can also set afterwards your default Scratch Org using sf config set [email protected].


With the new Salesforce CLI, use this command:

sf config set [email protected]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .