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

# Users

> Manage the users of an organization.

export const resource_0 = "user"

Users are the individual accounts with access to an organization. Membership starts with an invitation, and what a user can do is determined by the [groups](/docs/cli/groups) they belong to.

Commands that act on one {resource_0} take its ID either as a positional argument or with `--id`. If you omit it, the CLI opens an interactive picker, so always pass it in scripts.

## Subcommands

* [list](#list) — List users
* [invite](#invite) — Invite a user
* [delete](#delete) — Delete a user

***

## list

List users in an organization, along with their state and the number of groups each belongs to.

**Aliases:** `list`, `ls`

```bash theme={null}
nscale users list --org <org-id> [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Example

```bash theme={null}
nscale users list --org <org-id> --json
```

***

## invite

Invite a user into an organization. A user is identified by their canonical name, which is usually an email address.

Whether groups are accepted depends on how the organization authenticates its members:

* **Private organizations** — members are added explicitly, so at least one group is required. Omit `--group` and the CLI presents a group picker.
* **Public organizations** — members sign in with an email address on the organization's domain, and group membership is managed separately, so `--group` is rejected.

To check which kind an organization is, read its type — `adhoc` for private, `domain` for public:

```bash theme={null}
nscale organizations list -q ".[].metadata.name" -q ".[].spec.organizationType"
```

Use [`nscale groups list`](/docs/cli/groups#list) to discover the group IDs. For how groups and roles fit together, see [Groups and roles](/docs/manage/roles-and-groups).

`--state` sets the state of the user's **membership of this organization**, which is what governs their access to it:

* `pending` (the default) matches the Console flow — the member is listed as Pending and has no access until they join.
* `active` skips that step, so the membership is usable as soon as the person can sign in.
* `suspended` creates the membership with access already revoked.

<Note>
  `--state active` does not bypass account sign-up. If the person has no Nscale account yet, they must still complete the verification email before they can authenticate; the flag only decides whether their membership of this organization is waiting on them to join.
</Note>

```bash theme={null}
nscale users invite --org <org-id> --email <email> [flags]
```

### Flags

<table>
  <thead><tr><th>Flag</th><th>Description</th></tr></thead>

  <tbody>
    <tr><td><code>{"--org string"}</code></td><td>Organization ID</td></tr>
    <tr><td><code>{"--email string"}</code></td><td>The user's canonical name, usually an email address</td></tr>
    <tr><td><code>{"--group stringArray"}</code></td><td>Group ID to add the user to (repeatable)</td></tr>
    <tr><td><code>{"--state string"}</code></td><td>Membership state — <code>active</code>, <code>pending</code>, or <code>suspended</code> (default <code>pending</code>)</td></tr>
    <tr><td><code>{"--dry-run"}</code></td><td>Preview actions and payload without persisting</td></tr>
    <tr><td><code>{"-y, --yes"}</code></td><td>Automatically confirm the invitation</td></tr>

    <tr>
      <td>
        <code>
          {"--json"}
        </code>
      </td>

      <td>Emit the full JSON payload (mutually exclusive with <code>-q</code>)</td>
    </tr>

    <tr>
      <td>
        <code>
          {"-q, --query stringArray"}
        </code>
      </td>

      <td>jq filter for value extraction (see <a href="/docs/cli/query-output">Query output with <code>-q</code></a>)</td>
    </tr>
  </tbody>
</table>

### Examples

```bash theme={null}
nscale users invite --org <org-id> --email user@example.com
nscale users invite --org <org-id> --email user@example.com --group <group-id> --group <group-id>
# Interactive mode
nscale users invite
```

***

## delete

Delete an existing user from an organization.

```bash theme={null}
nscale users delete <user-id> --org <org-id> [flags]
```

### Flags

| Flag | Description |
| - | - |
| `--id string` | User ID |
| `--org string` | Organization ID |
| `--dry-run` | Preview actions and payload without persisting |
| `-y, --yes` | Automatically confirm deletion |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.