|
| 1 | +--- |
| 2 | +title: checkly rca |
| 3 | +description: 'Trigger and retrieve AI-powered root cause analyses for error groups.' |
| 4 | +sidebarTitle: 'checkly rca' |
| 5 | +--- |
| 6 | + |
| 7 | +<Note>Available since CLI v7.8.0.</Note> |
| 8 | + |
| 9 | +The `checkly rca` command lets you trigger and retrieve AI-powered root cause analyses (RCA) for error groups directly from the terminal. An RCA examines an error group and returns a classification, root cause explanation, user impact assessment, and suggested code fixes when available. |
| 10 | + |
| 11 | +<Accordion title="Prerequisites"> |
| 12 | +Before using `checkly rca`, ensure you have: |
| 13 | + |
| 14 | +- Checkly CLI installed |
| 15 | +- Valid Checkly account authentication (run `npx checkly login` if needed) |
| 16 | +- A Checkly plan that includes root cause analysis |
| 17 | + |
| 18 | +For additional setup information, see [CLI overview](/cli/overview). |
| 19 | +</Accordion> |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +```bash Terminal |
| 24 | +npx checkly rca <subcommand> [arguments] [options] |
| 25 | +``` |
| 26 | + |
| 27 | +## Subcommands |
| 28 | + |
| 29 | +| Subcommand | Description | |
| 30 | +|------------|-------------| |
| 31 | +| `run` | Trigger a root cause analysis for an error group. | |
| 32 | +| `get` | Retrieve a root cause analysis by ID. | |
| 33 | + |
| 34 | +## `checkly rca run` |
| 35 | + |
| 36 | +Trigger a new root cause analysis for an error group. The analysis runs asynchronously — use `--watch` to wait for the result in your terminal. |
| 37 | + |
| 38 | +**Usage:** |
| 39 | + |
| 40 | +```bash Terminal |
| 41 | +npx checkly rca run [options] |
| 42 | +``` |
| 43 | + |
| 44 | +**Options:** |
| 45 | + |
| 46 | +| Option | Required | Description | |
| 47 | +|--------|----------|-------------| |
| 48 | +| `--error-group, -e` | yes | The error group ID to analyze. | |
| 49 | +| `--watch, -w` | - | Wait for the analysis to complete and display the result. | |
| 50 | +| `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | |
| 51 | + |
| 52 | +### Run Options |
| 53 | + |
| 54 | +<ResponseField name="--error-group, -e" type="string"> |
| 55 | + |
| 56 | +The error group ID to trigger the analysis for. You can find error group IDs in the output of [`checkly checks get`](/cli/checkly-checks) when viewing a check with errors. |
| 57 | + |
| 58 | +**Usage:** |
| 59 | + |
| 60 | +```bash Terminal |
| 61 | +npx checkly rca run --error-group=<error-group-id> |
| 62 | +npx checkly rca run -e <error-group-id> |
| 63 | +``` |
| 64 | + |
| 65 | +</ResponseField> |
| 66 | + |
| 67 | +<ResponseField name="--watch, -w" type="boolean" default="false"> |
| 68 | + |
| 69 | +Wait for the analysis to complete and display the full result. Without this flag, the command returns immediately with the RCA ID and a pending status. |
| 70 | + |
| 71 | +Only works with `--output detail`. |
| 72 | + |
| 73 | +**Usage:** |
| 74 | + |
| 75 | +```bash Terminal |
| 76 | +npx checkly rca run --error-group=<error-group-id> --watch |
| 77 | +npx checkly rca run -e <error-group-id> -w |
| 78 | +``` |
| 79 | + |
| 80 | +</ResponseField> |
| 81 | + |
| 82 | +<ResponseField name="--output, -o" type="string" default="detail"> |
| 83 | + |
| 84 | +Set the output format. Use `json` for programmatic access or `md` for markdown. |
| 85 | + |
| 86 | +**Usage:** |
| 87 | + |
| 88 | +```bash Terminal |
| 89 | +npx checkly rca run --error-group=<error-group-id> --output=json |
| 90 | +npx checkly rca run -e <error-group-id> -o md |
| 91 | +``` |
| 92 | + |
| 93 | +</ResponseField> |
| 94 | + |
| 95 | +### Run Examples |
| 96 | + |
| 97 | +```bash Terminal |
| 98 | +# Trigger an RCA and wait for the result |
| 99 | +npx checkly rca run --error-group=err-abc-123 --watch |
| 100 | + |
| 101 | +# Trigger an RCA without waiting |
| 102 | +npx checkly rca run --error-group=err-abc-123 |
| 103 | + |
| 104 | +# Get the result as JSON |
| 105 | +npx checkly rca run --error-group=err-abc-123 --output=json |
| 106 | +``` |
| 107 | + |
| 108 | +## `checkly rca get` |
| 109 | + |
| 110 | +Retrieve an existing root cause analysis by its ID. If the analysis is still generating, use `--watch` to wait for completion. |
| 111 | + |
| 112 | +**Usage:** |
| 113 | + |
| 114 | +```bash Terminal |
| 115 | +npx checkly rca get <id> [options] |
| 116 | +``` |
| 117 | + |
| 118 | +**Arguments:** |
| 119 | + |
| 120 | +| Argument | Description | |
| 121 | +|----------|-------------| |
| 122 | +| `id` | The RCA ID to retrieve. | |
| 123 | + |
| 124 | +**Options:** |
| 125 | + |
| 126 | +| Option | Required | Description | |
| 127 | +|--------|----------|-------------| |
| 128 | +| `--watch, -w` | - | Wait for the analysis to complete if still generating. | |
| 129 | +| `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | |
| 130 | + |
| 131 | +### Get Options |
| 132 | + |
| 133 | +<ResponseField name="--watch, -w" type="boolean" default="false"> |
| 134 | + |
| 135 | +Wait for the analysis to complete if it is still generating. Without this flag, the command returns the current status immediately. |
| 136 | + |
| 137 | +Only works with `--output detail`. |
| 138 | + |
| 139 | +**Usage:** |
| 140 | + |
| 141 | +```bash Terminal |
| 142 | +npx checkly rca get <id> --watch |
| 143 | +npx checkly rca get <id> -w |
| 144 | +``` |
| 145 | + |
| 146 | +</ResponseField> |
| 147 | + |
| 148 | +<ResponseField name="--output, -o" type="string" default="detail"> |
| 149 | + |
| 150 | +Set the output format. Use `json` for programmatic access or `md` for markdown. |
| 151 | + |
| 152 | +**Usage:** |
| 153 | + |
| 154 | +```bash Terminal |
| 155 | +npx checkly rca get <id> --output=json |
| 156 | +npx checkly rca get <id> -o md |
| 157 | +``` |
| 158 | + |
| 159 | +</ResponseField> |
| 160 | + |
| 161 | +### Get Examples |
| 162 | + |
| 163 | +```bash Terminal |
| 164 | +# Retrieve a completed RCA |
| 165 | +npx checkly rca get rca-xyz-789 |
| 166 | + |
| 167 | +# Wait for a pending RCA to complete |
| 168 | +npx checkly rca get rca-xyz-789 --watch |
| 169 | + |
| 170 | +# Get the result as JSON |
| 171 | +npx checkly rca get rca-xyz-789 --output=json |
| 172 | +``` |
| 173 | + |
| 174 | +## RCA Output |
| 175 | + |
| 176 | +A completed root cause analysis includes: |
| 177 | + |
| 178 | +- **Classification** — the category of the error |
| 179 | +- **Root cause** — explanation of what caused the error |
| 180 | +- **User impact** — how the error affects end users |
| 181 | +- **Code fix** — suggested fix when available |
| 182 | +- **Evidence** — supporting artifacts from the analysis |
| 183 | +- **Reference links** — relevant external resources |
| 184 | + |
| 185 | +## Related Commands |
| 186 | + |
| 187 | +- [`checkly checks`](/cli/checkly-checks) - List, inspect, and analyze checks (includes error groups) |
0 commit comments