Skip to content

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.

Terminal window
dotnet new cratis-chronicle-console -n MyConsole

These templates scaffold a Chronicle client — pass --Database (MongoDB by default, or PostgreSQL, MsSql, SQLite) to choose which database the Chronicle kernel in docker-compose.yml persists to.

A single Program.cs with the whole story:

  • A ChronicleClient connected to the local development kernel (chronicle://localhost:35000, development credentials).
  • A [EventType] record — the fact your application produces.
  • A model-bound [FromEvent] projection — a read model kept in sync by Chronicle.
  • An IReactor — a callback that fires the moment the event is observed.

Start the infrastructure, run the app, and watch the reactor print:

Terminal window
docker-compose up -d
dotnet run

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.

The scaffolded project includes a .cratis/ai.json with the Cratis AI profiles, languages, and coding agent harnesses for this template — the Chronicle-on-.NET selection. Make sure the Cratis CLI is installed, then run:

Terminal window
cratis ai update

That installs the AI rules, skills, and harness integration for the coding agents you selected — AGENTS.md instructions plus .claude/, .cursor/, .github/, .opencode/, and .pi/ integration — and records what it installed in .cratis/ai.manifest.json. dotnet new prints this reminder after scaffolding, and re-running the command only refreshes Cratis-managed files, never yours. See the CLI AI documentation for the full command reference.