This repository contains all creation templates used by Cratis. It holds dotnet new project templates you can use to scaffold new event-sourced and CQRS applications built with Cratis Chronicle (event-sourcing database and processing runtime) and Cratis Arc (CQRS application framework for ASP.NET Core). Everything is MIT licensed and free to use.
| Template | Short name | What you get |
|---|---|---|
| Cratis Chronicle Console | cratis-chronicle-console | A console application connected to Cratis Chronicle |
| Cratis Chronicle Web | cratis-chronicle-web | An ASP.NET Core web application connected to Cratis Chronicle |
| Cratis Web Application | cratis | A full-stack web application with Arc (commands, queries, TypeScript proxy generation) and a React + Vite frontend using Cratis Components |
| Cratis Aspire Application | cratis-aspire | The full-stack web application orchestrated with .NET Aspire |
Quick steps to scaffold projects from these templates:
- Install the published templates from NuGet.org (one-time):
dotnet new install Cratis.Templates- Optional: install a specific version:
dotnet new install Cratis.Templates::<version>- Optional: install prerelease builds from GitHub Packages:
dotnet nuget add source --name cratis-github --username <github-username> --password <github-token> --store-password-in-clear-text https://nuget.pkg.github.com/cratis/index.json
dotnet new install Cratis.Templates::<version> --nuget-source https://nuget.pkg.github.com/cratis/index.json- List available templates and note the
Short Nameyou want:
dotnet new --list- Create a new project from a template (replace
<shortname>):
dotnet new <shortname> -n MyApp -o MyApp- Many templates accept parameters; run
dotnet new <shortname> --helpto see available options.
Important
The cratis and cratis-aspire templates keep selected NuGet references as Version="*" in the template source. Their post-creation package actions intentionally resolve those references and pin the generated project to the current latest package versions. The cratis template can also install frontend dependencies (yarn/pnpm/npm) as a post-creation step.
In an interactive terminal, dotnet new asks before running post-creation actions. When scaffolding non-interactively — CI pipelines, scripts, devcontainer postCreateCommand, or any context where stdin is not a TTY — opt in explicitly:
dotnet new cratis -n MyApp -o MyApp --allow-scripts yesTo pin NuGet package versions but skip the regular cratis frontend install, pass both --allow-scripts yes and --packageManager none. The cratis-aspire template does not auto-install frontend dependencies; follow the yarn install step in its generated README.md.
- Uninstall when needed:
dotnet new uninstall Cratis.TemplatesTo update to the latest version:
dotnet new updateThis updates all installed template packages to their latest versions.
To update only Cratis.Templates:
dotnet new uninstall Cratis.Templates
dotnet new install Cratis.TemplatesTo check which version you currently have installed:
dotnet new listLook for Cratis.Templates in the output to see the installed version.
To update to a specific version:
dotnet new uninstall Cratis.Templates
dotnet new install Cratis.Templates::<version>Prerequisites:
- .NET SDK (recommended 8.0+)
- Node.js and npm (if testing frontend/Vite templates)
dotnet pack Cratis.Templates.csproj -c Release -o ./nupkgs
dotnet new -i ./nupkgsIf you prefer to install directly from the template folder (unpacked):
dotnet new -i ./Cratis.Templatesdotnet new --listdotnet new <shortname> -n MyTestApp
cd MyTestApp
dotnet restore
dotnet build
dotnet runcd path/to/generated/frontend
npm install
npm run dev./verify-asset-layout.shScaffolds both Vite-based templates, builds their frontends, and checks that every
hashed build artifact lands under wwwroot/assets/ rather than at the wwwroot
root. A flat root layout cannot be expressed as a reverse-proxy, CDN or WAF path
rule — the artifacts are hash-named, change every build and share no prefix — so
the failure only shows up at deployment, as a blank page. CI runs the same script
against the applications it has already generated.
Pass application directories to check ones you have already scaffolded:
./verify-asset-layout.sh path/to/MyTestAppdotnet new -u <package-id-or-folder>Iterate on the template sources, repack, and reinstall to test changes quickly.
This project is part of Cratis — free, MIT-licensed tools for building event-sourced and CQRS applications.
- Chronicle — event-sourcing database and runtime. Orleans-based kernel, pluggable storage (MongoDB default; PostgreSQL, SQL Server, SQLite, in-memory), language-agnostic gRPC contracts. Docs
- Chronicle clients — first-class .NET SDK, plus TypeScript, Kotlin/Java, and Elixir; Python coming soon (pre-alpha). AI agents connect through the Chronicle MCP server.
- Arc — opinionated CQRS framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Works without event sourcing. Docs
- Components — React components aligned with Arc patterns. Docs
- CLI + Workbench — inspect and diagnose Chronicle from the terminal or the browser. Docs
- Model-first layer (experimental) — Studio, Screenplay, Stage, Scene, Prologue
- Supporting — Fundamentals, Specifications, Synopsis, Lens, Narrator, and free AI tooling (preview); Ensemble coming soon (pre-release)
- Samples — runnable event sourcing and CQRS samples for the whole stack
Everything Cratis publishes today is MIT licensed and free to use.