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

# Manage workspace members from the CLI

> Invite people to a Square Cloud workspace with a single-use code, change their permission group and remove them with squarecloud workspace member.

People join a workspace with an invite code that they generate themselves:

<Steps>
  <Step title="The new member generates a code">
    The person who wants to join runs `squarecloud workspace member invite-code` and sends the code to the workspace owner. The code works once and expires after 5 minutes.
  </Step>

  <Step title="The owner adds them">
    The owner runs `squarecloud workspace member add` with the workspace ID, the code and a permission group.
  </Step>
</Steps>

## Permission groups

`<group>` is one of:

| Group | What the member can do |
| - | - |
| `admin` | Full control of the shared applications: environment variables, snapshots, custom domains and deploy settings included. |
| `maintain` | Operational work: commits, start, stop and restart, files, DNS and cache purges. |
| `manager` | Monitoring and control: start, stop and restart, and deploy information. No commits, files or network changes. |
| `view` | Read only. |

The owner's own group is `owner`, which can't be given to anyone else. The help center has more on [workspace permissions](https://help.squarecloud.app/en-us/article/workspace-permissions-collaborators-12ahei1/).

## `squarecloud workspace member invite-code`

```bash Usage theme={"system"}
squarecloud workspace member invite-code
```

Generates your own single-use invite code, valid for 5 minutes.

```bash Output theme={"system"}
Your invite code (single-use, valid for 5 minutes):
  <inviteCode>
```

## `squarecloud workspace member add`

```bash Usage theme={"system"}
squarecloud workspace member add <workspaceID> <inviteCode> <group>
```

Adds the person who generated `<inviteCode>` to the workspace, with the given permission group. Only the workspace owner can add members, up to the member limit of the owner's plan.

```bash theme={"system"}
squarecloud workspace member add <workspaceID> <inviteCode> maintain
```

## `squarecloud workspace member update`

```bash Usage theme={"system"}
squarecloud workspace member update <workspaceID> <memberID> <group>
```

Changes a member's permission group. Take the member ID from [`workspace info`](/en/cli-reference/workspaces#squarecloud-workspace-info).

## `squarecloud workspace member remove`

```bash Usage theme={"system"}
squarecloud workspace member remove <workspaceID> <memberID> [-y]
```

| Flag | Description |
| - | - |
| `-y`, `--yes` | Skips the confirmation prompt. |

Removes a member from the workspace, after a `y/N` confirmation. Only the workspace owner can remove members. To leave a workspace yourself, use [`workspace leave`](/en/cli-reference/workspaces#squarecloud-workspace-leave).

## Related

| Command | API | JavaScript SDK | VS Code |
| - | - | - | - |
| `invite-code` | [`GET .../members/code`](/en/api-reference/endpoint/workspace/members/code) | [`api.workspaces.members.inviteCode()`](/en/sdks/js/workspaces) | [Copy My Invite Code](/en/vscode-extension/features#workspaces) |
| `add` | [`POST .../members`](/en/api-reference/endpoint/workspace/members/invite) | [`api.workspaces.members.add()`](/en/sdks/js/workspaces) | |
| `update` | [`PATCH .../members`](/en/api-reference/endpoint/workspace/members/perms) | [`api.workspaces.members.update()`](/en/sdks/js/workspaces) | |
| `remove` | [`DELETE .../members`](/en/api-reference/endpoint/workspace/members/kick) | [`api.workspaces.members.remove()`](/en/sdks/js/workspaces) | |
