Getting started with the CLI
You’ve got a Chronicle store running — maybe the local one from the Chronicle get-started, maybe a staging server a colleague set up. Things are happening inside it: events are landing, projections are folding them into read models, reactors are firing. Right now the only way to see any of that is to write code. Let’s fix that.
cratis is a terminal window into a running store. In the next couple of minutes you’ll install it, point it at your Chronicle, and run one command that proves the connection and shows you around. After that, looking at events, observers, or read models is a single command each — never a query.
Prerequisites
Section titled “Prerequisites”- Nothing extra to install the CLI itself — the steps below give you the
cratisbinary. - A running Chronicle store to connect to —
cratis get-startedconnects to a Chronicle server, so have one running first. The Chronicle get-started brings a local one up withdocker compose upin about a minute; against that local store there’s nothing to configure — the CLI finds it on its own.
Install it
Section titled “Install it”Pick the install that matches your machine. However you do it, you end up with the same cratis binary on your PATH.
-
Install the CLI.
Install with Homebrew brew tap cratis/cratisbrew install cratisUpgrade later with
brew upgrade cratis.Download the pre-built native binary from the latest release and put it on your
PATH:Install the native binary # x64 (Intel/AMD)curl -Lo cratis.tar.gz https://github.com/Cratis/cli/releases/latest/download/cratis-linux-x64.tar.gz# arm64: swap x64 for arm64 in the URL abovetar -xzf cratis.tar.gzsudo mv cratis /usr/local/bin/cratisTo upgrade, repeat with the newer release.
If you already have the .NET SDK (10 or newer), install it as a global tool — handy in CI and on Windows:
Install as a .NET global tool dotnet tool install -g Cratis.CliUpgrade with
dotnet tool update -g Cratis.Cli. -
Prove it’s there. Run
cratiswith no arguments. It prints the connection it’s pointing at — the active context’s name and the server URL it will talk to:Check the active connection cratisThe first time you run any
cratiscommand, it quietly creates adefaultcontext aimed atchronicle://localhost:35000— so on a local box this already points somewhere sensible. We’ll come back to what a context is. -
Connect and look around.
cratis get-starteddoes two things: it checks it can actually reach the server, then prints a guided summary of the commands you’ll reach for most, grouped by what you’re trying to do.Test the connection and get a tour cratis get-startedIf it reports a successful connection, you’re done — the CLI is installed and talking to your store.
How cratis decides where to connect
Section titled “How cratis decides where to connect”That worked with zero configuration, which is worth understanding rather than taking on faith. Every command needs one thing: a server to talk to. cratis resolves it by walking a short list of sources, top to bottom, and using the first one that’s set:
On your machine nothing above the default is set, so it lands on chronicle://localhost:35000 — your local store. That’s why “install and go” just works. The two layers above the context — the environment variable and the --server flag — are escape hatches for automation and one-off commands; you’ll meet them when you need them.
Point it at another store
Section titled “Point it at another store”A context is a named connection. You already have default; real work usually means a couple more — staging, production — so you can switch between them without retyping URLs.
Repoint the default at a different server:
cratis context set-value server chronicle://myserver.example.com:35000/Or keep default for local and add a named context per environment, then switch the active one:
cratis context create staging --server chronicle://staging.example.com:35000/cratis context set stagingFrom here on, every command talks to staging until you switch back. For CI and containers, skip contexts entirely and set CHRONICLE_CONNECTION_STRING in the environment — it wins over the active context but yields to an explicit --server. Full details are on the Context page.
Two niceties worth a minute
Section titled “Two niceties worth a minute”Tab completion. Let your shell finish commands and options for you:
cratis completions installIt detects your shell automatically (override with --shell bash|zsh|fish|powershell); on Windows it writes the hook to your PowerShell $PROFILE. Restart your shell to pick it up.
Teach your AI assistant about your store. Run cratis init inside a project and the CLI writes a CHRONICLE.md describing every command it can run, installs instruction files for Claude Code, GitHub Copilot, Cursor, and Windsurf, and adds a chronicle-diagnose slash command — so your assistant can help operate the store too:
cratis initRefresh the embedded snapshot after a CLI upgrade with cratis init --refresh. For the same catalog as raw JSON, run cratis llm-context (add --schema for its JSON Schema).
In a couple of minutes you installed cratis, watched it find your local Chronicle through the default context, and confirmed the connection with cratis get-started. You also saw the one rule that governs every command — flag, then environment variable, then context, then the local default — so nothing about where it connects is a mystery anymore.
Where to go next
Section titled “Where to go next”- Actually look at something — the Chronicle commands browse events, observers, and read models in a live store.
- Solve a real problem — the Scenarios walk through fixing a stuck observer, replaying a projection, and verifying events were appended.
- Manage connections properly — the Context page covers creating, switching, and inspecting contexts in depth.