---
title: "The edge tenant command"
slug: "the-edge-tenant-command"
abstract: "Reference for the Sitecore CLI edge tenant command for listing and selecting Experience Edge tenants."
---
# The edge tenant command

The Experience Edge plugin for Sitecore CLI provides the `edge tenant` command to help you identify the currently selected Edge tenant, list all available tenants for the organization, and switch the tenant.

> [!note]
> The `edge tenant` command and subcommands are only available with device/interactive login flow. Running these commands in a direct/client credentials flow results in the following error:
>
> This command is available only for device login flow. The environment <env-name> doesn't use device login flow

## Usage and options

You can use the `edge tenant` command as follows:

```shell
dotnet sitecore edge tenant [subcommand] [options]
```

Running the `tenant` command without any subcommands shows you the currently selected tenant for the organization. For example:

```shell
dotnet sitecore edge tenant
```

If you have already selected a tenant, the command displays:

```shell
<tenant-name> (id: <tenant-id>), belongs to <organization-id>
```

Otherwise, the command output is a warning and information on how to select a tenant:

```shell
The tenant to use is not chosen. Run 'dotnet sitecore edge tenant use --tenantId <tenantId>' command first.
```

You can use the following options with the `tenant` command:

| Option | Description |
| --- | --- |
| --env, --environment | Specifies the Experience Edge environment to target.Possible values: preprod, prodDefault: prod |
| -?, -h, --help | Displays developer help and usage information about the command. |

## Subcommands

You can use the following `tenant` subcommands:

- `list` - shows all the tenants the current user can access.
- `use` - selects a tenant.

### The list subcommand

The `edge tenant list` displays all the tenants the current user can access. For example:

```shell
dotnet sitecore edge tenant list
```

You can use the following options with the `list` subcommand:

| Option | Description |
| --- | --- |
| --env, --environment | The unique identifier of the target environment.Possible values: preprod, prodDefault: prod |
| -?, -h, --help | Display developer help and usage information about the command. |

### The use subcommand

The `edge tenant use` subcommand sets the selected tenant based on the provided tenant ID. For example:

```shell
dotnet sitecore edge tenant use --id <tenant-id>
```

You can use the following options with the `use` subcommand:

| Option | Description |
| --- | --- |
| --id, --tenant-id | The unique identifier of the tenant you want to select. |
| --env, --environment | The unique identifier of the target environment.Possible values: preprod, prodDefault: prod |
| -?, -h, --help | Display developer help and usage information about the command. |
