> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# domain

> cpln domain — Manage custom domains for routing traffic to your workloads.

Manage custom domains

For a detailed overview, please visit the [domain's](/reference/domain) reference page.

```none theme={null}
cpln domain [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln domain access-report <ref>  Show the access report for the referenced domain
  cpln domain audit [ref]          Retrieve audit trail events for the referenced domain
  cpln domain create               Create a new domain
  cpln domain delete <ref...>      Delete one or more referenced domains
  cpln domain edit <ref>           Edit the referenced domain, as YAML, within an editor
  cpln domain eventlog <ref>       Show the event log of the referenced domain  [aliases: log]
  cpln domain get [ref...]         Retrieve one or more referenced domains
  cpln domain patch <ref>          Update the referenced domain's metadata using an input file
  cpln domain permissions          Show the grantable permissions for a domain object type
  cpln domain query                Find all the domains based on the given query
  cpln domain tag <ref...>         Manage the tags belonging to one or more referenced domains

Options:
  --help  Show help  [boolean]
```

***

#### domain access-report

Show the access report for the referenced domain

**Usage**

```none theme={null}
cpln domain access-report <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <Note>
    The domain `demo.globalvirtualcloud.com` has already been added to the `demo-cpln-organization` organization
  </Note>

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain access-report demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------+--------------------------------------------------------+--------+
    |PERMISSION |PRINCIPAL                                               |GRANTED |
    |-----------|--------------------------------------------------------|--------|
    |create     |/org/demo-cpln-organization/group/superusers            |manage  |
    |create     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |delete     |/org/demo-cpln-organization/group/superusers            |manage  |
    |delete     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |edit       |/org/demo-cpln-organization/group/superusers            |manage  |
    |edit       |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |manage     |/org/demo-cpln-organization/group/superusers            |manage  |
    |manage     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |use        |/org/demo-cpln-organization/group/superusers            |manage  |
    |use        |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |view       |/org/demo-cpln-organization/group/superusers            |manage  |
    |view       |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |view       |/org/demo-cpln-organization/group/viewers               |view    |
    +-----------+--------------------------------------------------------+--------+
    ```
  </CodeGroup>
</Accordion>

***

#### domain audit

Retrieve audit trail events for the referenced domain

**Usage**

```none theme={null}
cpln domain audit [ref] [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.

  Command options:
    --subject  Filter by subject (serviceaccount name or user email)  [string]
    --context  Audit context name (the 'cpln' context displays Control Plane actions)  [string] [default: "cpln"]
    --since    Relative lookback window from now (e.g., 1h, 24h, 7d). Mutually exclusive with --from/--to  [string] [default: "7d"]
    --from     Start time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 7d, 1h). Cannot be used with --since  [string]
    --to       End time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 1d, 30m)  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### domain create

Create a new domain

**Usage**

```none theme={null}
cpln domain create --name DOMAIN_NAME [OPTIONS]
```

<Note>
  Ownership of the referenced domain is required by setting a TXT DNS entry.

  Review the [domain configuration instructions](/reference/domain) for details.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Fully qualified domain name (e.g., widgets.example.com)  [required]
    --description, --desc  Optional description, defaults to the name if not set
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain create --name demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The ownership of the referenced domain will be validated and if successful, added to the referenced organization.
    ```
  </CodeGroup>
</Accordion>

***

#### domain delete

Delete one or more referenced domains

**Usage**

```none theme={null}
cpln domain delete <ref...> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain delete demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The referenced domain will be removed from the referenced organization.
    ```
  </CodeGroup>
</Accordion>

***

#### domain edit

Edit the referenced domain, as YAML, within an editor

**Usage**

```none theme={null}
cpln domain edit <ref> [OPTIONS]
```

<Note>
  The default editor can be set by using the EDITOR environment variable.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replace, -r  Replace instead of patch/merge  [boolean] [default: false]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain edit demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    Your default editor will be launched.

    Once any modifications are saved, the updates will be sent to the API.
    ```
  </CodeGroup>
</Accordion>

***

#### domain eventlog

Show the event log of the referenced domain

**Usage**

```none theme={null}
cpln domain eventlog <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain eventlog demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The event log for the referenced domain will be shown.
    ```
  </CodeGroup>
</Accordion>

***

#### domain get

Retrieve one or more referenced domains

**Usage**

```none theme={null}
cpln domain get [ref...] [OPTIONS]
```

<Note>
  An empty reference will return all references
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Show a domain

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain get demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="coffee"        |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Show multiple domains

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain get demo.globalvirtualcloud.com demo2.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+----------------------------------+----------------------+
    |NAME                         |DESCRIPTION                       |TAGS                  |
    |-----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com  |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                             |                                  |drink="coffee"        |
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com      |cpln/protected="true" |
    |                             |                                  |demo-domain="true"    |
    +-----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### domain patch

Update the referenced domain's metadata using an input file

**Usage**

```none theme={null}
cpln domain patch <ref> --file FILE_NAME [OPTIONS]
```

<Note>
  Running this command with the option **`--file -`** sets the input to stdin. The input is required to be a valid JSON or YAML string (e.g., `{"description": "My new description"}` or `description: My new description`). To complete the update, press Control-D (or Control-Z if you are using Windows).
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --file, -f  File to load the patch from. Use `--file -` to enable input from stdin.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain patch demo.globalvirtualcloud.com --file update.json --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The changes within the JSON file will be performed against the referenced domain.
    ```
  </CodeGroup>
</Accordion>

***

#### domain permissions

Show the grantable permissions for a domain object type

**Usage**

```none theme={null}
cpln domain permissions [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln domain permissions --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------+-----------------------------------------+----------------------------------------+
    |NAME   |DESCRIPTION                              |IMPLIES                                 |
    |-------|-----------------------------------------|----------------------------------------|
    |create |Create new domain                        |                                        |
    |delete |Delete a domain                          |                                        |
    |edit   |Modify existing domains (only tags ca... |view, use                               |
    |manage |Full access                              |create, delete, edit, manage, use, view |
    |use    |Allow a principal to use this domain     |view                                    |
    |view   |Read-only access                         |                                        |
    +-------+-----------------------------------------+----------------------------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### domain query

Find all the domains based on the given query

**Usage**

```none theme={null}
cpln domain query QUERY_OPTIONS [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Query options:
    --match             Query filter type  [choices: "all", "none", "any"] [default: "all"]
    --property, --prop  Property to query
    --tag               Tag to query
    --rel               Relation to query

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <Note>
    Use the `--match` option to display **all**, **none**, or **any** of the results based on a given property or tag
  </Note>

  * Search for a domain based on the name property

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain query --match any --prop name=demo.globalvirtualcloud.com --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="coffee"        |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Search for a domain based on the description property

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain query --match any --prop description="FQDN: demo.globalvirtualcloud.com" --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="coffee"        |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Search for a domain based on a tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain query --match any --tag demo-domain="true" --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+-----------------------------+----------------------+
    |NAME                         |DESCRIPTION                  |TAGS                  |
    |-----------------------------|-----------------------------|----------------------|
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com |cpln/protected="true" |
    |                             |                             |demo-domain="true"    |
    +-----------------------------+-----------------------------+----------------------+
    ```
  </CodeGroup>

  * Search for a domain based on a property and tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain query --match any --prop description="FQDN: demo.globalvirtualcloud.com" --tag demo-domain="true" --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+----------------------------------+----------------------+
    |NAME                         |DESCRIPTION                       |TAGS                  |
    |-----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com  |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                             |                                  |drink="coffee"        |
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com      |cpln/protected="true" |
    |                             |                                  |demo-domain="true"    |
    +-----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### domain tag

Manage the tags belonging to one or more referenced domains

**Usage**

```none theme={null}
cpln domain tag <ref...> --tag KEY=VALUE [OPTIONS]
```

<Note>
  Built-in tags, which begin with cpln/\*, can't be modified.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Command options:
    --tag         Attach tags (e.g., --tag drink=water)
    --remove-tag  Remove tags (e.g., --remove-tag tagname)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Add a tag to a domain

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com --tag drink=water --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="water"         |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Update same tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com --tag drink=coffee --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="coffee"        |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Remove tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com --remove name --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +----------------------------+----------------------------------+----------------------+
    |NAME                        |DESCRIPTION                       |TAGS                  |
    |----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                            |                                  |drink="coffee"        |
    +----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>

  * Add same tag to multiple domain

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com demo2.globalvirtualcloud.com --tag multiple-domains=true --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+----------------------------------+------------------------+
    |NAME                         |DESCRIPTION                       |TAGS                    |
    |-----------------------------|----------------------------------|------------------------|
    |demo.globalvirtualcloud.com  |FQDN: demo.globalvirtualcloud.com |cpln/protected="true"   |
    |                             |                                  |drink="coffee"          |
    |                             |                                  |multiple-domains="true" |
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com      |cpln/protected="true"   |
    |                             |                                  |demo-domain="true"      |
    |                             |                                  |multiple-domains="true" |
    +-----------------------------+----------------------------------+------------------------+
    ```
  </CodeGroup>

  * Update same tag on multiple domain (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com demo2.globalvirtualcloud.com --tag multiple-domains=demo-domain --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+----------------------------------+-------------------------------+
    |NAME                         |DESCRIPTION                       |TAGS                           |
    |-----------------------------|----------------------------------|-------------------------------|
    |demo.globalvirtualcloud.com  |FQDN: demo.globalvirtualcloud.com |cpln/protected="true"          |
    |                             |                                  |drink="coffee"                 |
    |                             |                                  |multiple-domains="demo-domain" |
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com      |cpln/protected="true"          |
    |                             |                                  |demo-domain="true"             |
    |                             |                                  |multiple-domains="demo-domain" |
    +-----------------------------+----------------------------------+-------------------------------+
    ```
  </CodeGroup>

  * Remove same tag from multiple domain (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln domain tag demo.globalvirtualcloud.com demo2.globalvirtualcloud.com --remove multiple-domains --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+----------------------------------+----------------------+
    |NAME                         |DESCRIPTION                       |TAGS                  |
    |-----------------------------|----------------------------------|----------------------|
    |demo.globalvirtualcloud.com  |FQDN: demo.globalvirtualcloud.com |cpln/protected="true" |
    |                             |                                  |drink="coffee"        |
    |demo2.globalvirtualcloud.com |demo2.globalvirtualcloud.com      |cpln/protected="true" |
    |                             |                                  |demo-domain="true"    |
    +-----------------------------+----------------------------------+----------------------+
    ```
  </CodeGroup>
</Accordion>

***
