Skip to content

Template catalogue

The templates come from Cratis.Templates, Cratis.Templates.Kotlin, and Cratis.Templates.Java, installed on your machine under ~/.cratis/templates. You never install them by hand: the first cratis new downloads the latest set from NuGet, and cratis update keeps it current (see Where templates come from). --version uses another version for a single run:

Terminal window
cratis new cratis --language csharp --version <version>

cratis new list shows four project concepts. The cratis web application has C#, Kotlin, and Java variants; the other three projects are C# only. Inspect a project’s parameters with cratis new <template> --language <name> --parameters.

Instantiating requires --language. The language selects the template package and the project variant, defaulting to cratis when no project is named:

LanguageDefault projectPackage
csharp (C#; c# accepted)cratisCratis.Templates
kotlincratisCratis.Templates.Kotlin
javacratisCratis.Templates.Java

The three packages release in lockstep, so one installed version covers all of them; --version overrides it for a single run.

Terminal window
cratis new --language csharp -n MyApp
cratis new --language kotlin -n MyKotlinApp
cratis new --language java -n MyJavaApp

Languages and templates are matched case-insensitively. For another project, use its short name, for example cratis new cratis-aspire --language csharp. If the default is missing from a selected package, the error lists templates available for that language.

Package IDs and complete version tokens are validated before acquisition. Exact versions keep their spelling, including supported legacy numeric versions, prereleases and build metadata. New feed and local .nupkg installs are extracted and structurally checked in a contained staging directory before promotion. A failed replacement keeps the previous install; existing complete caches remain usable offline without redownload. Completion metadata records installation, not package authenticity. Explicitly selected local folders remain trusted inputs.

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 --language csharp -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 --language csharp -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 --language csharp -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 --language csharp -n MyApp -o MyApp
ParameterTypeChoicesDefaultDescription
--Frameworkchoicenet10.0net10.0Target framework

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

Terminal window
cratis new cratis --language csharp -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 template set is installed under ~/.cratis/templates:

~/.cratis/templates/
├── installed.json # the version cratis new uses, and its packages
└── packages/
├── Cratis.Templates/1.8.0/
├── Cratis.Templates.Kotlin/1.8.0/
└── Cratis.Templates.Java/1.8.0/
  • First use. When nothing is installed, cratis new downloads the latest stable set from the NuGet feeds your NuGet.Config lists (nuget.org by default) and records it in installed.json. It prints one line saying so.
  • Afterwards. cratis new uses the installed set and does not touch the network, so it works offline.
  • Updating. cratis update updates the CLI, then checks for a newer set and installs it. Skip that step with cratis update --no-templates. A set is recorded as installed only after every one of its packages has downloaded completely, so an interrupted or failed download leaves the set you had in place; the update reports why the templates were not updated.
  • Offline first use. If the first download fails, cratis new falls back to the newest complete set already in ~/.cratis/templates/packages (an earlier CLI version may have downloaded one) and says so. With nothing there, it stops with exit code 2 and tells you to try again once NuGet is reachable, or to pass --template-path with a local package.

The set’s packages and the oldest CLI that can use it are listed in the catalog the Cratis.Templates package carries (catalog.json, maintained in the Cratis/Templates repository). When a newer set needs a newer CLI, cratis update keeps the installed set and tells you which CLI version it needs. A package without a catalog is treated as the three packages above.

To start over, delete ~/.cratis/templates — the next cratis new downloads the latest set again.

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> --language <name> --package <package-id> --version <version>
cratis new <short-name> --language <name> --template-path <folder-or-nupkg>

A template’s tags.language must match --language; untagged templates count as C#. 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.