# `jadpo incident`

Explain a production event.

Explains production events from log text (area 17): a file, standard input (`-`), or, with no argument in a terminal, text given at its prompt. It finds each `operation.failed` and `failure.rejected` event inside whatever wraps it, keeps one a request, and puts the requests that ended at the same place in one block. For each it names the line in the build that ran, rebuilt from the commit the event's build stamp names and checked against its build id, with the lines around it, then where that code is now, found by its stable identity, or says it changed, was removed or was split. The text is read as untrusted: nothing in it is run or followed.

```text
jadpo incident [file]
```

## Arguments

- `file` (optional): The log text: a file, or `-` for standard input

## Flags

- `--full`: List every place and request

## On every command

- `--json`: Print data for tools instead of text
- `--full`: Show everything a report shortens
- `--help`: Show every flag, with examples
- `--color <when>`: Choose when to use colour

`jadpo incident --json` writes one JSON document to standard output instead of text, with the same exit code. The document has `schemaVersion`, `command` (`"incident"`), `ok`, `data` (what the command produced, `null` when it failed) and `diagnostics` (each error with its `rule`, `reason`, `next` and `help`). A command that needs a terminal refuses `--json` and names the flags that do the same job.

## Examples

```text
# Explain the events saved to a file
jadpo incident event.json
# Explain what the clipboard holds
pbpaste | jadpo incident -
```

## Errors

- [`cli.incident_arguments`](/docs/errors/cli.incident_arguments.md): A `jadpo incident` command is given more than one file, one it can't read, or nothing where there is no terminal to give text at
- [`cli.incident_invalid`](/docs/errors/cli.incident_invalid.md): The log text `jadpo incident` was given holds no deployable's `operation.failed` or `failure.rejected` event
- [`toolchain.project_not_found`](/docs/errors/toolchain.project_not_found.md): You ran a command that works on a project in a folder with no `app.jadpo`, in it or in any folder above it
