The Chronicle Console template
The cratis-chronicle-console template is the smallest complete Chronicle application: a console project that connects to a running Chronicle, appends an event, and shows the event flowing through a projection and a reactor.
dotnet new cratis-chronicle-console -n MyConsoleYou need the .NET 10 SDK and Docker with the Compose plugin.
Options
Section titled “Options”| Option | Values | Default |
|---|---|---|
--Database | MongoDB, PostgreSQL, MsSql, SQLite | MongoDB |
--Framework | net10.0 | net10.0 |
--SkipAiUpdateInstructions | true, false | false |
The template scaffolds a Chronicle client. --Database changes only where the Chronicle kernel in docker-compose.yml stores its data; the console code is the same for every choice.
What you get
Section titled “What you get”A single Program.cs holds the whole story:
- A
ChronicleClientcreated without arguments, which connects to the local development kernel (chronicle://localhost:35000with the development client credentials), and an event store named after your project. - A
[EventType]record,TestEvent: the fact your application produces. - A model-bound
[FromEvent<TestEvent>]read model,TestProjection, kept in sync by Chronicle. - An
IReactor,TestReactor, that prints eachTestEventit observes.
Run it
Section titled “Run it”Start the infrastructure, then run the app from an interactive terminal:
docker compose up -ddotnet runThe app appends one TestEvent and prints:
Received event with message: Hello world!It then waits for a key press so the reactor has time to run; press any key to exit. Because it reads a key, run it in a terminal rather than with redirected input. Each run appends another event to the same event source, some-event-source.
When you are done, docker compose down removes the containers. With the default MongoDB setup, the events are stored inside the Chronicle container and are removed with it.
What it is for
Section titled “What it is for”This template is the fastest way to check that your machine, your container, and your client packages agree, and the cleanest place to experiment with events, projections, and reactors without an HTTP layer in the way. When you are ready for commands, queries, and a frontend, move to the Cratis Web Application template.
AI assistance
Section titled “AI assistance”The scaffolded project includes a .cratis/ai.json selecting the cratis/application/chronicle-dotnet profile with the C# language. Make sure the Cratis CLI is installed, then run:
cratis ai updateThat installs the AI rules, skills, and harness integration for the selected coding agents (AGENTS.md plus .claude/, .cursor/, .github/, .opencode/, and .pi/) and records what it installed in .cratis/ai.manifest.json. dotnet new prints this reminder after scaffolding; cratis new runs the update for you. Running it again refreshes only Cratis-managed files. See the CLI AI documentation for the full command reference.