Event Types
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.
cratis chronicle event-types listOptions
Section titled “Options”| Flag | Description |
|---|---|
-e, --event-store <NAME> | Event store to inspect. Defaults to default. |
-n, --namespace <NAME> | Namespace to inspect. Defaults to Default. |
Output tip
Section titled “Output tip”Use --output plain when scanning for event type names. The JSON format includes the full JSON Schema definition for every event type, which can be up to 34 times larger than the plain output. Reserve JSON for when you need schema details.
cratis chronicle event-types list --output plainExamples
Section titled “Examples”List all event types in the default event store:
cratis chronicle event-types listList event types in a specific event store and namespace:
cratis chronicle event-types list -e myapp -n tenant-aGet only the identifiers for scripting:
cratis chronicle event-types list -qShows the full JSON Schema definition for a single event type.
cratis chronicle event-types show <EVENT_TYPE>Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
EVENT_TYPE | Event type identifier. Use the type name alone (e.g. UserRegistered) to get the latest generation, or append +<generation> (e.g. UserRegistered+1) to get a specific generation. |
Options
Section titled “Options”| Flag | Description |
|---|---|
-e, --event-store <NAME> | Event store to inspect. Defaults to default. |
-n, --namespace <NAME> | Namespace to inspect. Defaults to Default. |
Examples
Section titled “Examples”Show the latest schema for an event type:
cratis chronicle event-types show UserRegisteredShow a specific generation:
cratis chronicle event-types show UserRegistered+1Get machine-readable JSON output:
cratis chronicle event-types show UserRegistered -o json