alias set

Set one or more aliases on your local computer.

Aliases are user-defined short names that make it easier to use the CLI. For example, users often set an alias for a scratch org usernames because they’re long and unintuitive. Check the –help of a CLI command to determine where you can use an alias.

You can associate an alias with only one value at a time. If you set an alias multiple times, the alias points to the most recent value. Aliases are global; after you set an alias, you can use it in any Salesforce DX project on your computer.

Use quotes to specify an alias value that contains spaces. You typically use an equal sign to set your alias, although you don’t need it if you’re setting a single alias in a command.

force:alias:set

Flag Name (Long)Flag Name (Short)Description
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.

Set an alias for a scratch org username:

Set multiple aliases with a single command:

Set an alias that contains spaces:

Set a single alias without using an equal sign: