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:
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.
Languages
Section titled “Languages”Instantiating requires --language. The language selects the template package
and the project variant, defaulting to cratis when no project is named:
| Language | Default project | Package |
|---|---|---|
csharp (C#; c# accepted) | cratis | Cratis.Templates |
kotlin | cratis | Cratis.Templates.Kotlin |
java | cratis | Cratis.Templates.Java |
The three packages release in lockstep, so one installed version covers all of them; --version
overrides it for a single run.
cratis new --language csharp -n MyAppcratis new --language kotlin -n MyKotlinAppcratis new --language java -n MyJavaAppLanguages 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 acquisition
Section titled “Package acquisition”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.
How templates are organized
Section titled “How templates are organized”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.
cratis — Cratis Web Application
Section titled “cratis — Cratis Web Application”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.
cratis new cratis --language csharp -n MyApp -o MyApp| Parameter | Type | Choices | Default | Description |
|---|---|---|---|---|
--Framework | choice | net10.0 | net10.0 | Target framework |
--packageManager | choice | yarn, pnpm, npm, none | yarn | Package 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.
cratis new cratis --language csharp -n MyApp --Framework net10.0 --packageManager none --allow-scripts nocratis-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.
cratis new cratis-aspire --language csharp -n MyApp -o MyApp| Parameter | Type | Choices | Default | Description |
|---|---|---|---|---|
--Framework | choice | net10.0 | net10.0 | Target 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.
cratis new cratis-chronicle-console --language csharp -n MyApp -o MyApp| Parameter | Type | Choices | Default | Description |
|---|---|---|---|---|
--Framework | choice | net10.0 | net10.0 | Target 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.
cratis new cratis-chronicle-web --language csharp -n MyApp -o MyApp| Parameter | Type | Choices | Default | Description |
|---|---|---|---|---|
--Framework | choice | net10.0 | net10.0 | Target framework |
Database selection
Section titled “Database selection”--database selects the database backend the scaffolded application uses:
cratis new cratis --language csharp -n MyApp --database postgresqlThe 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.
Where templates come from
Section titled “Where templates come from”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 newdownloads the latest stable set from the NuGet feeds yourNuGet.Configlists (nuget.org by default) and records it ininstalled.json. It prints one line saying so. - Afterwards.
cratis newuses the installed set and does not touch the network, so it works offline. - Updating.
cratis updateupdates the CLI, then checks for a newer set and installs it. Skip that step withcratis 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 newfalls 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 code2and tells you to try again once NuGet is reachable, or to pass--template-pathwith 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.
Templates from other packages
Section titled “Templates from other packages”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:
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.