Skip to content

VS Code extension (Narrator)

Last released · v3.0.2

Tools

Explore Chronicle from your editor

When you’re deep in a slice and something looks wrong, the question is usually “what’s actually in the event log?” Narrator answers it without a context switch: it adds a Chronicle Explorer to the VS Code activity bar, so you can browse your event store, page through a sequence, and inspect event and read-model schemas right next to the code you’re writing.

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. It connects to your active Chronicle context on startup. If no context is configured, run Narrator: Connect to Chronicle from the Command Palette and enter a server URL.

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

Narrator reads the same configuration file the CLI uses, ~/.cratis/config.json, so if you’ve already pointed the CLI at a store, the extension picks it up. A minimal config looks like this:

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

A context can also name an eventStore and a namespace. It connects to the active context on startup and watches the file, reloading when it changes. To use a config in a non-standard location, set the narrator.configPath setting; leave it empty to use ~/.cratis/config.json.

Browse the store

Navigate event stores and namespaces down to their event types, read models, observers, and projections in the Chronicle Explorer tree.

Page through events

Open an event sequence into a paged viewer showing sequence number, event type, event source, when it occurred, and the payload.

Inspect schemas

Open an event type’s or read model’s JSON schema, and open a projection’s declaration.

Switch contexts

Add, edit, delete, and switch between Chronicle server contexts without editing JSON by hand.

A Details pane sits below the explorer and shows the selected node’s context and content as key/value tables, so selecting an event or read model shows its data inline.