# prb risk command reference

Manage risks. This page documents **7 commands** under `prb risk`.

Flags and examples below come from the command definitions. A **Required** flag is explicitly marked required by Cobra; an unmarked flag can still be needed by runtime validation or a non-interactive workflow. Empty strings and empty lists are registered defaults, not sample values.

Every command also inherits the [global flags](/docs/developers/cli/commands#global-flags). Run `prb <command> --help` to check your installed version. Replace placeholder IDs and names in source examples before running them. Return to the [complete CLI command reference](/docs/developers/cli/commands) to browse another command.

## Commands

| Command                                 | Description                                                      | Usage                  | Source                                                                                                 |
| --------------------------------------- | ---------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------ |
| [`prb risk`](#prb-risk)                 | Manage risks.                                                    | `prb risk <command>`   | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/risk.go#L35)            |
| [`prb risk create`](#prb-risk-create)   | Create a new risk.                                               | `prb risk create`      | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/create/create.go#L70)   |
| [`prb risk delete`](#prb-risk-delete)   | Delete a risk and its analysis history.                          | `prb risk delete <id>` | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/delete/delete.go#L43)   |
| [`prb risk list`](#prb-risk-list)       | List risks in an organization or unplanned risks on an analysis. | `prb risk list`        | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/list/list.go#L110)      |
| [`prb risk publish`](#prb-risk-publish) | Publish the risk register as a document version.                 | `prb risk publish`     | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/publish/publish.go#L83) |
| [`prb risk update`](#prb-risk-update)   | Update a risk.                                                   | `prb risk update <id>` | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/update/update.go#L64)   |
| [`prb risk view`](#prb-risk-view)       | View a risk.                                                     | `prb risk view <id>`   | [View implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/view/view.go#L82)       |

## prb risk

Manage risks.

### Usage

```text
prb risk <command>
```

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/risk.go#L35).

## prb risk create

Create a new risk.

### Usage

```text
prb risk create
```

### Flags

| Flag            | Type   | Default | Required | Description              |
| --------------- | ------ | ------- | -------- | ------------------------ |
| `--category`    | string | `""`    | —        | Risk category (required) |
| `--description` | string | `""`    | —        | Risk description         |
| `--name`        | string | `""`    | —        | Risk name (required)     |
| `--note`        | string | `""`    | —        | Risk note                |
| `--org`         | string | `""`    | —        | Organization ID          |

### Examples

```bash
# Create a risk interactively
prb risk create

# Create a risk non-interactively
prb risk create --name "Data breach" --category "Security"
```

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/create/create.go#L70).

## prb risk delete

Delete a risk and its analysis history.

### Usage

```text
prb risk delete <id>
```

Requires 1 positional argument.

### Flags

| Flag          | Type    | Default | Required | Description              |
| ------------- | ------- | ------- | -------- | ------------------------ |
| `--yes`, `-y` | boolean | `false` | —        | Skip confirmation prompt |

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/delete/delete.go#L43).

## prb risk list

List risks in an organization or unplanned risks on an analysis.

### Usage

```text
prb risk list
```

Accepts no positional arguments.

### Flags

| Flag                | Type    | Default  | Required | Description                                                                                                    |
| ------------------- | ------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `--after`           | string  | `""`     | —        | Cursor from the previous page (the Next cursor line)                                                           |
| `--filter`, `-q`    | string  | `""`     | —        | Filter risks by search query                                                                                   |
| `--json`            | boolean | `false`  | —        | Output JSON (same as --output json)                                                                            |
| `--limit`, `-L`     | integer | `30`     | —        | Maximum number of risks to list                                                                                |
| `--order-by`        | string  | `""`     | —        | Order by field (CREATED_AT, REFERENCE_ID, NAME, CATEGORY, TREATMENT, INHERENT_RISK_SCORE, RESIDUAL_RISK_SCORE) |
| `--order-direction` | string  | `"DESC"` | —        | Sort direction (ASC, DESC)                                                                                     |
| `--org`             | string  | `""`     | —        | Organization ID                                                                                                |
| `--output`, `-o`    | string  | `""`     | —        | Output format: json, table (default)                                                                           |
| `--risk-analysis`   | string  | `""`     | —        | List unplanned scenario-linked risks on a risk analysis                                                        |

### Examples

```bash
# List risks in the default organization
prb risk list

# Filter risks by name
prb risk list --filter "data breach"

# List unplanned scenario-linked risks on an analysis
prb risk ls --risk-analysis <id>

# List risks sorted by inherent score
prb risk ls --order-by INHERENT_RISK_SCORE --output json
```

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/list/list.go#L110).

## prb risk publish

Publish the risk register as a document version.

### Usage

```text
prb risk publish
```

### Flags

| Flag         | Type         | Default | Required | Description                                                 |
| ------------ | ------------ | ------- | -------- | ----------------------------------------------------------- |
| `--approver` | string array | `[]`    | —        | Approver profile ID (can be repeated; ignored with --minor) |
| `--minor`    | boolean      | `false` | —        | Publish as a minor version (no approval flow)               |
| `--org`      | string       | `""`    | —        | Organization ID                                             |

### Examples

```bash
# Publish the risk register
prb risk publish --org ORG_ID

# Publish with approvers
prb risk publish --org ORG_ID --approver PROFILE_ID1 --approver PROFILE_ID2
```

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/publish/publish.go#L83).

## prb risk update

Update a risk.

### Usage

```text
prb risk update <id>
```

Requires 1 positional argument.

### Flags

| Flag            | Type   | Default | Required | Description      |
| --------------- | ------ | ------- | -------- | ---------------- |
| `--category`    | string | `""`    | —        | Risk category    |
| `--description` | string | `""`    | —        | Risk description |
| `--name`        | string | `""`    | —        | Risk name        |
| `--note`        | string | `""`    | —        | Risk note        |

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/update/update.go#L64).

## prb risk view

View a risk.

### Usage

```text
prb risk view <id>
```

Requires 1 positional argument.

### Flags

| Flag             | Type    | Default | Required | Description                          |
| ---------------- | ------- | ------- | -------- | ------------------------------------ |
| `--json`         | boolean | `false` | —        | Output JSON (same as --output json)  |
| `--output`, `-o` | string  | `""`    | —        | Output format: json, table (default) |

[View command implementation](https://github.com/getprobo/probo/blob/main/pkg/cmd/risk/view/view.go#L82).
