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). The JVM templates scaffold the same full-stack application on Spring Boot — in Kotlin or Java — using Arc for Kotlin and Java. Everything is MIT licensed and free to use.
The templates ship as three NuGet packages. Cratis.Templates contains every template, including the Kotlin and Java versions of the cratis web application, which --language Kotlin or --language Java selects. Cratis.Templates.Kotlin and Cratis.Templates.Java publish the JVM templates on their own. The Cratis CLI can scaffold all of them with cratis new.
| 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 |
| Cratis Kotlin Application | cratis --language Kotlin |
A full-stack web application with Arc and Chronicle on Spring Boot — Kotlin backend, TypeScript proxy generation through the Arc Gradle plugin, and a React + Vite frontend |
| Cratis Java Application | cratis --language Java |
The same full-stack application authored in Java — Spring Boot backend, TypeScript proxy generation through the Arc Gradle plugin, and a React + Vite frontend |
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.
--store-password-in-clear-textwrites the token unencrypted to your userNuGet.Config, and the command line lands in your shell history; use a token with onlyread:packagesand remove the source withdotnet nuget remove source cratis-githubwhen you are done:
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 the Cratis templates and note the
Short Nameyou want:
dotnet new list cratis- 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. The .NET templates targetnet10.0, so you need the .NET 10 SDK. The Kotlin and Java templates need a JDK 17 to build. - All application templates (
cratis— C#, Kotlin, and Java — andcratis-aspire) and the Chronicle client templates accept a--Databasechoice —MongoDB(default),PostgreSQL,MsSql, orSQLite— selecting which database the Chronicle kernel persists its event stores and read models to, and which read-model package the generated .NET application uses.
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.
Keep frontend dependencies on their latest published releases. The declarations set explicit minimum versions rather than relying only on npm's latest tag, which can resolve an older version while satisfying peer dependencies. Components 4 supplies the starter's provider, widgets, and styles directly; no PrimeReact adapter is required. Commit the generated application's lockfile to record the versions you installed. The frontend templates include a .yarnrc.yml with nodeLinker: node-modules, because the TypeScript 7 compiler cannot resolve Yarn Plug'n'Play installs. Incompatibilities between current releases should be reported and fixed, not bypassed with --force or worked around by downgrading.
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.
Every template ships a .cratis/ai.json describing its Cratis AI configuration — the Cratis AI profiles, languages, and coding agent harnesses for that template:
| Template | Profiles | Languages |
|---|---|---|
cratis-chronicle-console, cratis-chronicle-web |
cratis/application/chronicle-dotnet |
csharp |
cratis, cratis-aspire |
cratis/application/csharp |
csharp, typescript |
cratis --language Kotlin |
cratis/application/kotlin |
kotlin, typescript |
cratis --language Java |
cratis/application/java |
java, typescript |
All templates select every harness (claude, codex, copilot, cursor, opencode, pi). After scaffolding with dotnet new, which prints a reminder about this, make sure the Cratis CLI is installed (see https://www.cratis.io/cli/) and run:
cratis ai updateThis installs the Cratis-owned AI rules, skills, and harness integration for the selected coding agents — AGENTS.md instructions plus .claude/, .cursor/, .github/, .opencode/, and .pi/ integration — and records what it installed in .cratis/ai.manifest.json. Commit the installed content with the generated project. Re-running cratis ai update refreshes only Cratis-managed files. cratis new runs this step itself. The generated README.md and the template documentation describe this in full.
- 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 10 SDK (
global.jsonrequires 10.0 withlatestFeatureroll-forward) - Latest stable Node.js and npm, for the templates with a Vite frontend (CI resolves the latest Node release)
- A JDK 17 for building the scaffolded Kotlin and Java applications
- Docker, if you want to run the scaffolded applications against a local Chronicle
To keep your normally installed templates untouched, install into an isolated template-engine hive and pass the same --debug:custom-hive to every dotnet new command:
dotnet pack Cratis.Templates.csproj -c Release -o ./nupkgs
dotnet new install ./nupkgs/Cratis.Templates.1.0.0.nupkg --debug:custom-hive ./Testing/hive
dotnet new list cratis --debug:custom-hive ./Testing/hiveCratis.Templates.Kotlin.csproj and Cratis.Templates.Java.csproj pack the standalone JVM packages the same way. Testing/ is ignored by Git and excluded from the template projects' compile globs, so it is a safe place for local scaffolds.
To install straight from the template folders into your normal template store, as CI does, run:
./install-local.shIt uninstalls and reinstalls this repository folder with dotnet new install <repo> --force.
dotnet new cratis -n MyTestApp -o ./Testing/MyTestApp --allow-scripts yes --debug:custom-hive ./Testing/hive
cd ./Testing/MyTestApp
dotnet build
docker compose up -d
dotnet runFor a Kotlin or Java scaffold, add --language Kotlin or --language Java, then run ./gradlew build and ./gradlew bootRun instead of the dotnet commands.
cd path/to/generated/app
npm install
npm run devThe starters use the latest TypeScript 7 compiler. Following TypeScript's side-by-side setup, @typescript/native aliases TypeScript 7 and supplies the tsc executable used by the build. The typescript alias points to the latest @typescript/typescript6 compatibility package for tools such as typescript-eslint that need the JavaScript compiler API, which TypeScript 7.0 does not provide. This does not switch the build to the older tsc6 executable.
Check the compiler actually used by the build with ./node_modules/.bin/tsc --version rather than inferring it from the compatibility package's name.
./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/MyTestAppThe cratis and cratis-aspire samples return SomeId, an EventSourceId<Guid>-derived identity, alongside the registered event. This tells Arc to append under that identity and return the same value to the caller. A raw Guid in the tuple is only a response value, not an append identity. The generated TypeScript response remains Guid.
With .NET 10 and Python 3 installed, check already-scaffolded application directories:
./verify-registration-identity.sh path/to/MyApp path/to/MyAspireApp/MyAspireAppThis regenerates proxies and checks their response type, executes the actual scaffolded registration command, compares its response to the appended event and projected Listing.Id, and runs a follow-up command using that response identity. It uses in-process Arc/Chronicle scenarios, not a running Chronicle server; the lookup scenario is seeded with the verified projected instance under its own identity. Test-only packages and runner files stay under the repository's ignored .ai-work/; they are not added to generated applications. CI runs this check for both templates.
dotnet new uninstall <package-id-or-folder>A custom hive is just a folder: delete ./Testing/hive to discard it.
Iterate on the template sources, repack, and reinstall to test changes quickly.
If you hit a problem with a project generated from these templates, ask the Cratis team and other developers on the Cratis Discord. Template bugs and feature requests belong in GitHub Issues.
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.