alias Commands

Use the alias commands to manage username aliases.

alias:list

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

Command Syntax

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

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--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, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn

Help for alias:list

Example:

1$ sfdx force:alias:list

alias:set

Sets an alias that the Salesforce CLI can use for various commands and tasks.

Command Syntax

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

Parameters

--json
Optional

Format output as JSON.

Type: boolean
--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, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
Default value: warn

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 YourAlias=username@example.com
1$ sfdx force:alias:set YourAlias=username@example.com YourOtherAlias=devhub@example.com
1$ sfdx force:alias:set AliasToDelete=