# Listen for events

Canonical page: https://docs.ovok.com/cli/reference/listen

{/* Written by pnpm docs:generate from the command's spec. Edit the spec, not this page. */}

```bash
ovok listen [options]
```

Each `--fhir` criteria opens a FHIR WebSocket Subscription; `--forward-to` receives every event. Each event is signed with X-Signature, the way a rest-hook Subscription signs it. Set `OVOK_LISTEN_SECRET` to sign with your own secret; otherwise listen makes one and prints it. `--signals-url` creates a temporary Signals webhook; Signals posts to it, so it must be public. Stopping removes everything listen created and names anything it could not remove.

## Options [#options]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `--fhir <criteria>` | string, repeatable |  | A FHIR Subscription criteria, such as Observation; repeat it for more |
| `--forward-to <url>` | string |  | The local URL each FHIR event is posted to; `--fhir` needs it |
| `--signals-url <url>` | string |  | A public URL, such as a tunnel, for a temporary Signals webhook |
| `--signals-event <type>` | string, repeatable | `alert.*` | A Signals event type to send; repeat it for more |
| `--signals-reach all\|attached` | string | `all` | All residents, or only those attached to the webhook |
| `--profile <name>` | string | `default` | The saved profile to use |

## While it runs in a terminal [#while-it-runs-in-a-terminal]

- `r`: Resends the last FHIR event
- `c`: Clears the screen
- `q, Ctrl+C`: Stops and removes what listen created

## Examples [#examples]

```bash
ovok listen --fhir Observation --forward-to http://localhost:3000/fhir
ovok listen --signals-url https://<your-tunnel>/signals --signals-event alert.triggered
```
