alias Commands

Use the alias commands to manage username aliases.

alias:list

Lists the aliases that sfdx can use for various commands and tasks.

Command Syntax

sfdx force:alias:list
[--json]
[--loglevel LOGLEVEL]

Parameters

--json
Optional




Format output as JSON.

Type: flag
--loglevel LOGLEVEL
Optional




The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: error

Help for alias:list

Example:

1$ sfdx force:alias:list

alias:set

Sets an alias that sfdx can use for various commands and tasks.

Command Syntax

sfdx force:alias:set
[--json]
[--loglevel LOGLEVEL]

Parameters

--json
Optional




Format output as JSON.

Type: flag
--loglevel LOGLEVEL
Optional




The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: error

Help for alias:set

You can associate an alias with only one username at a time. If you’ve set an alias multiple times, the alias points to the most recent username.

To delete an alias, run "sfdx force:alias:set" with no username.

Examples:

1$ sfdx force:alias:set DefaultOrg=me@my.org
1$ sfdx force:alias:set DefaultOrg=me@my.org DevHubOrg=me@myhub.org
1$ sfdx force:alias:set AliasToDelete=