SFDX: How to change org’s alias?

I have an org connected in sfdx with an alias that I would like to change.

I don’t see an alias key in the corresponding ~/.sfdx/org.json file. I also don’t see anything mentioned about this on the org commands documentation.

Is there a way to do this via sfdx-cli without connecting to or creating the org again?


You can use force:alias:set:

sfdx force:alias:set newAlias=username@domain.com

The original alias is automatically removed/renamed with this command.

Source : Link , Question Author : Brand0R , Answer Author : sfdcfox

Leave a Comment