# div result

> Print the JSON result a run wrote to DIVERGENT_RESULT_PATH, or one value from it.

## Synopsis

```text
div result <run> [path]
```

Prints the run's result, or the value at `path` in it.

## Arguments

| Argument | Description |
| --- | --- |
| `<run>` | Run name or ID. |
| `[path]` | Dotted path into the result, such as `metrics.accuracy`. |

## Flags

| Flag | Description | Default |
| --- | --- | --- |
| `--token <key>` | API key to use. | see [Configuration](https://docs.divergentlabs.xyz/compute/cli/configuration.md) |
| `--api-url <url>` | API URL to use. | see [Configuration](https://docs.divergentlabs.xyz/compute/cli/configuration.md) |

## Output

Without a path, the whole result as JSON. With a path, the value at that path: a string as plain text, anything else as JSON.

## The result file

| Property | Value |
| --- | --- |
| Location | the path in `DIVERGENT_RESULT_PATH` (`/tmp/divergent/result.json`) |
| Format | one JSON object |
| Maximum size | 64 KiB. A larger result is discarded, not truncated. |
| When it is read | after the run's process exits. The last version written is kept. |
| Secrets | values of the org's [secrets](https://docs.divergentlabs.xyz/compute/cli/secrets.md) are masked |

## Exit codes

| Code | Meaning |
| --- | --- |
| `0` | The result, or the value, was printed. |
| `1` | The run has not finished, wrote no result, wrote something that is not a JSON object, or has no value at the path. The reason is printed to stderr. |
| `2` | Invalid arguments. |

## Examples

```bash
div result run-7
div result run-7 metrics.accuracy
div result run-7 | jq '.metrics'
acc=$(div result run-7 metrics.accuracy) || exit 1
```

See [Report a run's metrics and check them](https://docs.divergentlabs.xyz/compute/guides/results.md).
