Skip to content

Cratis Narrator — inspect Chronicle in VS Code

Last released · v3.0.3

Cratis Narrator is a VS Code extension for inspecting Cratis Chronicle event stores beside your code. When an app shows unexpected data, use its Chronicle Explorer to read the recorded events and inspect schemas before changing the app. Narrator reads Chronicle data; it does not execute application commands.

Narrator is published on the Visual Studio Marketplace as Cratis Narrator - Chronicle Explorer (publisher cratis).

  1. Open the Extensions view in VS Code (⇧⌘X / Ctrl+Shift+X).

  2. Search for Narrator and install Cratis Narrator - Chronicle Explorer, or install it from the Marketplace listing.

  3. Open the Narrator icon in the activity bar. If you already have an active Chronicle context, Narrator connects to it on startup. Otherwise, choose Add Context in the explorer and enter a context name and server URL. To retry a disconnected context, run Connect to Chronicle from the Command Palette.

The source lives at github.com/Cratis/Narrator.

A context is a named Chronicle connection. Narrator reads the CLI’s configuration file, ~/.cratis/config.json, so you can reuse an existing CLI context rather than enter the server again. A minimal config looks like this:

{
"activeContext": "default",
"contexts": {
"default": {
"server": "chronicle://localhost:35000"
}
}
}

Narrator connects to the active context on startup and watches the file for changes. To use a file elsewhere, set narrator.configPath; leave it empty to use ~/.cratis/config.json. Adding, editing, deleting, or switching contexts in Narrator writes to this file, so it also changes the configuration the CLI reads when both use the same path.

A context can name an eventStore and a namespace, but those values do not restrict the explorer to that store or namespace. Expand the connected context, choose an event store, then choose its namespace before opening a sequence. Narrator is separate from Lens: it connects directly to Chronicle and does not use the development user or tenant selected in your browser.

If the context stays disconnected, check the server URL and credentials, then open the Chronicle output channel in VS Code for connection errors. Narrator uses Chronicle’s gRPC endpoint, not an Arc application’s HTTP address.

Expand an event store and namespace in Chronicle Explorer to find event sequences, event types, read models, observers, and projections. Select a node to see its metadata in the Details pane below the explorer. A read-model node describes the model and its schema; it is not a viewer for the model’s stored rows.

To investigate a recorded change, open an event sequence with Browse Events. The paged viewer shows each event’s sequence number, type, event source, and occurrence time. Select an event to inspect its content and context.

Use Open Schema on an event type or read model to read its JSON schema in an editor tab. Open Declaration opens a projection’s declarative source when one is available; a model-bound projection has no declaration to open.

Follow CLI getting started to configure a Chronicle connection or perform store operations from the terminal. To send commands or queries to a running Arc app instead of inspecting its stored events, use the Lens browser extension.