

# Buildkite CLI team command

The `bk team` command allows you to manage organization teams from the command line.

## Commands

| Command | Description |
| --- | --- |
| `bk team list` | List teams. |
| `bk team view` | View team information. |
| `bk team create` | Create a new team. |
| `bk team update` | Update a team. |
| `bk team delete` | Delete a team. |

## List teams

List teams.

```bash
bk team list [flags]
```

### Flags

| Flag | Description |
| --- | --- |
| `-o`, `--output=""` | Output format. One of: json, yaml, text |
| `--debug` | Enable debug output for REST API calls |
| `--json` | Output as JSON |
| `--limit=100` | Maximum number of teams to return |
| `--per-page=30` | Number of teams per page |
| `--text` | Output as text |
| `--yaml` | Output as YAML |

### Examples

List all teams:

```bash
bk team list
```

List teams in JSON format:

```bash
bk team list -o json
```

List up to 200 teams:

```bash
bk team list --limit 200
```

## View a team

View team information.

```bash
bk team view <team-uuid> [flags]
```

### Arguments

| Argument | Description |
| --- | --- |
| `<team-uuid>` | UUID of the team to view |

### Flags

| Flag | Description |
| --- | --- |
| `-o`, `--output=""` | Output format. One of: json, yaml, text |
| `--debug` | Enable debug output for REST API calls |
| `--json` | Output as JSON |
| `--text` | Output as text |
| `--yaml` | Output as YAML |

### Examples

View a team:

```bash
bk team view my-team-uuid
```

View team in JSON format:

```bash
bk team view my-team-uuid -o json
```

## Create a team

Create a new team.

```bash
bk team create <name> [flags]
```

### Arguments

| Argument | Description |
| --- | --- |
| `<name>` | Name of the team |

### Flags

| Flag | Description |
| --- | --- |
| `-o`, `--output=""` | Output format. One of: json, yaml, text |
| `--[no-]members-can-create-pipelines` | Whether members can create pipelines |
| `--[no-]members-can-create-registries` | Whether members can create registries |
| `--[no-]members-can-create-suites` | Whether members can create test suites |
| `--[no-]members-can-destroy-packages` | Whether members can destroy packages |
| `--[no-]members-can-destroy-registries` | Whether members can destroy registries |
| `--debug` | Enable debug output for REST API calls |
| `--default` | Whether this is the default team for new members |
| `--default-member-role="member"` | Default role for new members: member or maintainer |
| `--description=STRING` | Description of the team |
| `--json` | Output as JSON |
| `--privacy="visible"` | Privacy setting for the team: visible or secret |
| `--text` | Output as text |
| `--yaml` | Output as YAML |

### Examples

Create a team with default settings:

```bash
bk team create my-team
```

Create a private team with a description:

```bash
bk team create my-team --description "My team" --privacy secret
```

Create a team where members cannot create pipelines:

```bash
bk team create my-team --no-members-can-create-pipelines
```

## Update a team

Update a team.

```bash
bk team update <team-uuid> [flags]
```

### Arguments

| Argument | Description |
| --- | --- |
| `<team-uuid>` | UUID of the team to update |

### Flags

| Flag | Description |
| --- | --- |
| `-o`, `--output=""` | Output format. One of: json, yaml, text |
| `--[no-]members-can-create-pipelines` | Whether members can create pipelines |
| `--[no-]members-can-create-registries` | Whether members can create registries |
| `--[no-]members-can-create-suites` | Whether members can create test suites |
| `--[no-]members-can-destroy-packages` | Whether members can destroy packages |
| `--[no-]members-can-destroy-registries` | Whether members can destroy registries |
| `--debug` | Enable debug output for REST API calls |
| `--default` | Whether this is the default team for new members |
| `--default-member-role=STRING` | Default role for new members: member or maintainer |
| `--description=DESCRIPTION` | New description for the team |
| `--json` | Output as JSON |
| `--name=STRING` | New name for the team |
| `--privacy=STRING` | Privacy setting: visible or secret |
| `--text` | Output as text |
| `--yaml` | Output as YAML |

### Examples

Rename a team:

```bash
bk team update my-team-uuid --name "New Team Name"
```

Change a team's privacy:

```bash
bk team update my-team-uuid --privacy secret
```

Update description and default member role:

```bash
bk team update my-team-uuid --description "Updated description" --default-member-role maintainer
```

## Delete a team

Delete a team.

```bash
bk team delete <team-uuid>
```

### Arguments

| Argument | Description |
| --- | --- |
| `<team-uuid>` | UUID of the team to delete |

### Flags

| Flag | Description |
| --- | --- |
| `--debug` | Enable debug output for REST API calls |

### Examples

Delete a team (with confirmation prompt):

```bash
bk team delete my-team-uuid
```

Delete a team without confirmation:

```bash
bk team delete my-team-uuid --yes
```
