Skip to content

Event type inspection with Cratis CLI

An event type is a registered schema that describes the shape of a domain event stored in Chronicle. Each event type has a name, a generation number, and a JSON Schema definition. Generations allow schemas to evolve over time while preserving older events.

Lists all registered event types in the specified event store and namespace.

Terminal window
cratis chronicle event-types list
Flag Description
-e, --event-store <NAME> Event store to inspect. Defaults to the active context’s event store, then default.
-n, --namespace <NAME> Namespace to inspect. Defaults to the active context’s namespace, then Default.

Use --output plain when scanning event types.

Terminal window
cratis chronicle event-types list --output plain

List all event types in the default event store:

Terminal window
cratis chronicle event-types list

List event types in a specific event store and namespace:

Terminal window
cratis chronicle event-types list -e myapp -n tenant-a

Get only the identifiers for scripting:

Terminal window
cratis chronicle event-types list -q

Shows the full JSON Schema definition for a single event type.

Terminal window
cratis chronicle event-types show <EVENT_TYPE>
Argument Description
EVENT_TYPE Event type identifier. Use the type name alone (e.g. UserRegistered) to get generation 1, or append +<generation> (e.g. UserRegistered+1) to get a specific generation.
Flag Description
-e, --event-store <NAME> Event store to inspect. Defaults to the active context’s event store, then default.
-n, --namespace <NAME> Namespace to inspect. Defaults to the active context’s namespace, then Default.

Show the generation 1 schema for an event type:

Terminal window
cratis chronicle event-types show UserRegistered

Show a specific generation:

Terminal window
cratis chronicle event-types show UserRegistered+1

Get machine-readable JSON output:

Terminal window
cratis chronicle event-types show UserRegistered -o json