Skip to content

Template catalogue

The CLI ships a programmatic catalogue pinned to a published version of Cratis.Templates1.3.0 at the time of writing. The pin makes scaffolding reproducible; --version overrides it when you want a different one:

Terminal window
cratis new cratis --version 1.2.2

All four templates come from the same package, are written in C#, and share the same parameter conventions. List them any time with cratis new; inspect one template’s parameters with cratis new <template> --parameters.

Instantiating requires --language. The language selects the template package and the template instantiated when none is named:

LanguageDefault templatePackage
csharp (C#; c# accepted)cratisCratis.Templates
kotlincratis-kotlinCratis.Templates.Kotlin
javacratis-javaCratis.Templates.Java

The three packages release in lockstep and share the catalogue pin; --version overrides all of them together.

Terminal window
cratis new --language csharp -n MyApp # the C# cratis template

Templates are matched case-insensitively, and a specific template from the language’s package can be named: cratis new cratis-aspire --language csharp.

Templates are concepts: the cratis concept is one template with C#, Kotlin, and Java derivatives, formalized by the packages themselves — the derivatives share a groupIdentity, each declares its language in tags.language, and the C# member carries the higher precedence so it is the concept’s default. The listing and the wizard collapse them into one entry; the language question (or --language) selects the derivative. Every concept also declares its databases through the Database parameter’s choices.

The full-stack starting point: a Cratis web application with an Arc backend, a React frontend built with Vite, and the Cratis AI configuration wired in. Available in C#, Kotlin, and Java — same concept, same questions, same databases, three language runtimes.

Terminal window
cratis new cratis -n MyApp -o MyApp
ParameterTypeChoicesDefaultDescription
--Frameworkchoicenet10.0net10.0Target framework
--packageManagerchoiceyarn, pnpm, npm, noneyarnPackage manager for frontend dependencies

The template adds the Cratis and Cratis.Arc.MongoDB package references with versions resolved at scaffold time, restores packages when dotnet is available, installs frontend dependencies through your chosen package manager (a script post action — see the —allow-scripts contract), and prints getting-started instructions. Choose none to skip frontend tooling entirely.

Terminal window
cratis new cratis --language csharp -n MyApp --Framework net10.0 --packageManager none --allow-scripts no

cratis-aspire — Cratis Aspire Application

Section titled “cratis-aspire — Cratis Aspire Application”

The web application with .NET Aspire orchestration: a solution with composition and infrastructure projects, the Aspire dashboard, and the full observability stack.

Terminal window
cratis new cratis-aspire -n MyApp -o MyApp
ParameterTypeChoicesDefaultDescription
--Frameworkchoicenet10.0net10.0Target framework

The scaffold is a multi-project solution; each project’s package references are resolved to concrete versions, so the output is buildable the moment restore runs.

cratis-chronicle-console — Cratis Chronicle Console

Section titled “cratis-chronicle-console — Cratis Chronicle Console”

The smallest starting point: a console application connected to a Chronicle event store, with a docker-compose file for the server.

Terminal window
cratis new cratis-chronicle-console -n MyApp -o MyApp
ParameterTypeChoicesDefaultDescription
--Frameworkchoicenet10.0net10.0Target framework

cratis-chronicle-web — Cratis Chronicle Web

Section titled “cratis-chronicle-web — Cratis Chronicle Web”

A minimal web application connected to a Chronicle event store — the console template’s web sibling.

Terminal window
cratis new cratis-chronicle-web -n MyApp -o MyApp
ParameterTypeChoicesDefaultDescription
--Frameworkchoicenet10.0net10.0Target framework

--database selects the database backend the scaffolded application uses:

Terminal window
cratis new cratis -n MyApp --database postgresql

The value is matched case-insensitively against the supported backends — mongodb, postgresql, mssql and sqlite — and defaults to mongodb. It is applied as the template’s Database parameter, so a template authors its database support the way it authors any parameter: choices on the parameter constrain the offered backends, conditions switch on it (#if (Database == PostgreSQL) with quoteless literals enabled), and switch or derived symbols derive values from it. When the parameter declares choices, the selection is injected in the choice’s canonical casing.

The templates in the catalogue today target MongoDB. A template that declares no Database parameter ignores the default and rejects an explicit --database with an error naming the template, so an unsupported selection is never silently dropped.

The catalogue is the curated default, not a boundary. Any package that follows the same layout — a .template.config/template.json at any depth — can be instantiated:

Terminal window
cratis new <short-name> --package <package-id> --version <version>
cratis new <short-name> --template-path <folder-or-nupkg>

Local folder feeds in your NuGet.Config are honored the same as nuget.org, which makes inner-loop iteration on templates straightforward: pack locally, point a feed at the output, scaffold, repeat.