---
schema_version: "1"
id: 661f2ab138be4688e531b82fe34c3ca872a943fefb8074d31820d4898618e252
title: alias set
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/alias/cli_reference_alias_set.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_alias_set.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4212d0e9ad3b7a49064c6e0a7ef87717dfaec0fc3279d23542f1c6cc25b57628
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# alias set

Set one or more aliases on your local computer.

## Description for alias set

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.

## Aliases for alias set

`force:alias:set`

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |

## Examples for alias set

Set an alias for a scratch org username:

```shell
sf alias set my-scratch-org=test-sadbiytjsupn@example.com
```

Set multiple aliases with a single command:

```shell
sf alias set my-scratch-org=test-sadbiytjsupn@example.com my-other-scratch-org=test-ss0xut7txzxf@example.com
```

Set an alias that contains spaces:

```shell
sf alias set my-alias='alias with spaces'
```

Set a single alias without using an equal sign:

```shell
sf alias set my-scratch-org test-ss0xut7txzxf@example.com
```
<!-- prettier-ignore-end -->
