---
title: "User group CLI reference"
description: "Customer-hosted cloud features"
---

# User group CLI reference

#### Customer-hosted cloud features

:::note
Some features are only available on customer-hosted clouds. Reach out to [support@anyscale.com](mailto:support@anyscale.com) for info.
:::

## User group CLI

### `anyscale user-group list` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale user-group list [OPTIONS]`

List user groups in the organization.

**Options**

-   **`--max-items`**: Maximum number of user groups to return.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale user-group list --max-items 50
ID            Name
------------  ----------------
ug_abc123     Engineering
ug_def456     Data Science
ug_ghi789     Platform Team
```
:::

::::

### `anyscale user-group get` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale user-group get [OPTIONS]`

Get a specific user group by ID.

**Options**

-   **`--id`**: The ID of the user group to retrieve.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale user-group get --id ug_abc123
ID               ug_abc123
Name             Engineering
Organization ID  org_abc123
Created At       2025-01-15 10:30:00 UTC
Updated At       2025-01-15 10:30:00 UTC
```
:::

::::

### `anyscale user-group membership list` Beta

:::warning
This command undergoes rapid iteration. Users must be tolerant of change.
:::

**Usage**

`anyscale user-group membership list [OPTIONS]`

List all user groups with their members.

Shows each user group and which users are members of that group.

Output is JSON. Use --output to save to a file.

**Options**

-   **`--output/-o`**: Write JSON output to a file instead of stdout.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale user-group membership list
{
  "Engineering": [
    "alice@example.com",
    "charlie@example.com"
  ],
  "Data Science": [
    "bob@example.com"
  ]
}

# Save output to a file
$ anyscale user-group membership list --output memberships.json
```
:::

::::

## User group models

### `UserGroup`

A user group in the organization.

#### Fields

-   **`id` (str)**: The unique identifier of the user group.
-   **`name` (str)**: The name of the user group.
-   **`org_id` (str)**: The organization ID.
-   **`created_at` (datetime)**: When the user group was created.
-   **`updated_at` (datetime)**: When the user group was last updated.

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale

user_group = anyscale.user_group.get(id="ug_abc123")
print(f"{user_group.id}: {user_group.name}")
```
:::

::::

---

Previous: [Service](/reference/cli/service.md) | Next: [User](/reference/cli/user.md)