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.
cratis chronicle event-types listOptions
Section titled “Options”| 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. |
Output tip
Section titled “Output tip”Use --output plain when scanning event types.
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 generation 1, 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 the active context’s event store, then default. |
-n, --namespace <NAME> |
Namespace to inspect. Defaults to the active context’s namespace, then Default. |
Examples
Section titled “Examples”Show the generation 1 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