# Organizations and workspaces

Create and manage organizations, workspaces, and their members from the CLI, and choose the default workspace for later commands.

Source: https://www.agentclash.dev/docs/guides/orgs-and-workspaces
Markdown export: https://www.agentclash.dev/md/docs/guides/orgs-and-workspaces

AgentClash is multi-tenant. An **organization** groups people and ownership. A **workspace** lives inside an organization and holds the resources you work with: builds, deployments, challenge packs, secrets, and runs. Most commands act on one workspace at a time.

## Organizations

```bash
agentclash org create --name "Acme"
agentclash org list
agentclash org get <orgId>
agentclash org update <orgId> --name "Acme Inc"
```

`org create` accepts an optional `--slug`; one is generated if you omit it. `org update --status` takes `active` or `archived`. `org list` supports `--limit` and `--offset`.

### Organization members

```bash
agentclash org members list <orgId>
agentclash org members invite <orgId> --email dev@example.com --role org_member
agentclash org members update <membershipId> --role org_admin
agentclash org members update <membershipId> --status suspended
```

Roles are `org_admin` and `org_member`. Membership status is `active`, `suspended`, or `archived`.

## Workspaces

```bash
agentclash workspace create --org <orgId> --name "Support evals"
agentclash workspace list --org <orgId>
agentclash workspace get <workspaceId>
agentclash workspace update <workspaceId> --name "Support evals v2"
agentclash workspace update <workspaceId> --public-packs=true
```

`workspace update --status` takes `active` or `archived`. `--public-packs` controls whether the workspace may use public challenge packs.

### Workspace members

Workspace member commands act on the selected workspace, so set it first (see below) or pass `--workspace <id>`.

```bash
agentclash workspace members list
agentclash workspace members invite --email dev@example.com --role workspace_member
agentclash workspace members update <membershipId> --role workspace_viewer
```

Invite roles are `workspace_admin`, `workspace_member`, and `workspace_viewer`.

## Choose the default workspace

```bash
agentclash workspace list
agentclash workspace use <workspaceId>
```

`workspace use` saves the ID to `~/.config/agentclash/config.yaml`. For the guided post-login flow, use `agentclash link`. In CI, set `AGENTCLASH_WORKSPACE` or pass `--workspace` instead of relying on saved config.

> Info: `workspace list` uses your default organization when you do not pass `--org`.

## See also

- [Quickstart](https://www.agentclash.dev/md/docs/getting-started/quickstart) - first login and workspace selection
- [CLI configuration](https://www.agentclash.dev/md/docs/reference/config) - config file and environment variables
- [Builds and versions](https://www.agentclash.dev/md/docs/guides/builds-and-versions) - first resources to create in a workspace
- [CLI reference](https://www.agentclash.dev/md/docs/reference/cli) - every flag for `org` and `workspace`