stream(format: StreamFormat = typer.Option(StreamFormat.json, '--format', help='Output format (json or text)'), output_file: str = typer.Option(None, '--output-file', help='File to write events to'), account: bool = typer.Option(False, '--account', help='Stream events for entire account, including audit logs'), run_once: bool = typer.Option(False, '--run-once', help='Stream only one event'))
Subscribes to the event stream of a workspace, printing each event
as it is received. By default, events are printed as JSON, but can be
printed as text by passing --format text.
emit(event: str = typer.Argument(help='The name of the event'), resource: str = typer.Option(None, '--resource', '-r', help="Resource specification as 'key=value' or JSON. Can be used multiple times."), resource_id: str = typer.Option(None, '--resource-id', help='The resource ID (shorthand for --resource prefect.resource.id=<id>)'), related: Optional[str] = typer.Option(None, '--related', help='Related resources as JSON string'), payload: Optional[str] = typer.Option(None, '--payload', '-p', help='Event payload as JSON string'))
Emit a single event to Prefect.Examples:
Copy
# Simple event with resource IDprefect event emit user.logged_in --resource-id user-123# Event with payloadprefect event emit order.shipped --resource-id order-456 --payload '{"tracking": "ABC123"}'# Event with full resource specificationprefect event emit customer.subscribed --resource '{"prefect.resource.id": "customer-789", "prefect.resource.name": "ACME Corp"}'