---
title: "The cloud login command"
slug: "the-cloud-login-command"
abstract: "Reference for the Sitecore CLI cloud login command authenticating with an Organization."
---
# The cloud login command

The Sitecore XM Cloud plugin provides the `cloud login` command. The command authenticates a person through the Sitecore CLI with a SitecoreAI Organization, granting them access tokens and claims based on authorization.

Initial credentials and endpoints are stored in the `Sitecore.DevEx.Extensibility.XMCloud<version>\plugin\plugin.json` file. After logging in, you can find them in the `.sitecore\user.json` file.

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

## Usage

You can use the `cloud login` command as follows:

```shell
dotnet sitecore cloud login [options]
```

You can run the command without any options.

To log in to a SitecoreAI Organization, the Sitecore CLI XM Cloud plugin allows two flows of authentication and authorization:

- An interactive user login using a device code flow.
- A non-interactive client login using a client credentials flow. This is used by clients such as Continuous Integration (CI) servers.

For interactive user login using a device code authentication flow, use the command:

```shell
dotnet sitecore cloud login
```

For non-interactive client logins using client credential flows, use the command:

```shell
dotnet sitecore cloud login --client-credentials --client-id <clientId> --client-secret <clientSecret>
```

## Options

The `cloud login` command has the following options:

| Option | Description |
| --- | --- |
| --allow-write, -aw | A Boolean parameter specifying if writing (pushing) data to the SitecoreAI environment is allowed.Default: False |
| --authority, --auth | Specifies the Identity Server used to authenticate to the Sitecore Cloud system and Organization.Default: the value set with the SaaS Identity auth URL. |
| --audience | Specifies the audience for authentication to the Sitecore Cloud system and Organization. In production, provide one of the following audiences:To access the environment, https://api.sitecorecloud.io.To access the Sitecore deployment using the XM Cloud DevEx plugin, https://xmcloud-cm.sitecorecloud.io.XM Cloud is now SitecoreAISome code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated. |
| --client-id | Specifies the client ID used for the Sitecore Cloud system and Organization authentication. |
| --client-secret | Specifies the client secret used for authentication to the Sitecore Cloud system and Organization. |
| --client-credentials | A Boolean parameter specifying whether to use the client credentials flow. Use it for authentication flows with continuous integration and automation tools. |
| --xmcloudhost | Specifies the SitecoreAI hosting URL.XM Cloud is now SitecoreAISome code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated. |
| --xmcloudmonitoringhost | Specifies the SitecoreAI MonitoringAPI hosting URL |
| --config | Path to the folder containing the sitecore.json file.Default: the root directory of the Sitecore project solution. |
| --verbose, -v | Write additional information about the command. |
| --trace, -t | Write diagnostics and detailed information about the command. |
| -?, -h, --help | Display developer help and usage information about the command. |
