> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

#  

# `prefect event`

```command theme={null}
prefect event [OPTIONS] COMMAND [ARGS]...
```

> [!NOTE]
>
> Stream events.

## `prefect event stream`

```command theme={null}
prefect event stream [OPTIONS]
```

> [!NOTE]
>
> Subscribe to the event stream, printing each event as it is received.

> **Options**
>
> **--format**
>
> Output format (json or text)
>
> **--output-file**
>
> File to write events to
>
> **--account**
>
> Stream events for entire account, including audit logs
>
> **--run-once**
>
> Stream only one event

## `prefect event emit`

```command theme={null}
prefect event emit [OPTIONS] EVENT
```

> [!NOTE]
>
> Emit a single event to Prefect.

> **Arguments**
>
> **EVENT** `string` *required*

> **Options**
>
> **--resource**
>
> Resource specification as 'key=value' or JSON. Can be used multiple times.
>
> **--resource-id**
>
> The resource ID (shorthand for --resource prefect.resource.id=\<id>)
>
> **--related**
>
> Related resources as JSON string
>
> **--payload**
>
> Event payload as JSON string

> [!NOTE]
>
> **Example:**
>
> ```bash theme={null}
> # Simple event with resource ID
> $ prefect event emit user.logged_in --resource-id user-123
>
> # Event with payload
> $ prefect event emit order.shipped --resource-id order-456 --payload '{"tracking": "ABC123"}'
>
> # Event with full resource specification
> $ prefect event emit customer.subscribed --resource '{"prefect.resource.id": "customer-789", "prefect.resource.name": "ACME Corp"}'
> ```
