Newer Version Available
Log Out of an Org
For security purposes, you can use the Salesforce CLI to log out of any org you’ve
previously authorized. This practice prevents other users from accessing your orgs if you don’t
want them to.
To log out of an org, use force:auth:logout. This example uses the alias my-hub-org to log out.
1sfdx force:auth:logout --targetusername my-hub-orgTo log out of all your orgs, including scratch orgs, use the --all parameter.
1sfdx force:auth:logout --allTo access an org again, other than a scratch org, reauthorize it.
When you log out of an org, it no longer shows up in the force:org:list output. If you log out of a Dev Hub org, the associated scratch orgs show up only if you specify the --all parameter.