Skip to content

Getting started with the Cratis templates

Everything you need is one NuGet package: Cratis.Templates. Install it once per machine:

Terminal window
dotnet new install Cratis.Templates

To install a specific version:

Terminal window
dotnet new install Cratis.Templates::1.2.0

List the templates and their short names:

Terminal window
dotnet new cratis

You should see the four Cratis templates alongside the built-in .NET templates. Each template has its own help page with every option:

Terminal window
dotnet new cratis -h

Two ways to scaffold: dotnet new and cratis new

Section titled “Two ways to scaffold: dotnet new and cratis new”

The templates work unchanged through both doors:

Terminal window
dotnet new install Cratis.Templates # the .NET SDK path — needs the SDK installed
cratis new # the CLI path — no .NET SDK required at all

cratis new is the Cratis CLI’s own scaffolding command. It ships a self-contained template engine that reads this package’s template.json files directly, so the same templates, the same parameters and the same post actions run on a machine with nothing but cratis installed — package references with Version="*" are resolved to concrete versions through the CLI’s own NuGet client. The one toolchain-dependent step is dotnet restore: it runs when dotnet is on your PATH and is otherwise reported with instructions, never silently skipped.

Terminal window
cratis new # list the four templates
cratis new cratis -n MyStore # scaffold — same parameters as dotnet new
cratis new cratis -n MyStore --packageManager pnpm --Framework net10.0

No authoring changes are needed for any of this — a template that works through dotnet new works through cratis new. See the CLI creating-projects documentation for the full command reference, the --allow-scripts contract, and how the two template stores stay isolated from each other.

The cratis template creates a complete full-stack application — ASP.NET Core backend with Arc, Chronicle event sourcing, and a React frontend:

Terminal window
dotnet new cratis -n MyStore
cd MyStore

The template asks which frontend package manager you use (yarn, pnpm, npm, or none) and which target framework you want (net8.0, net9.0, or net10.0). Both can also be passed directly:

Terminal window
dotnet new cratis -n MyStore --packageManager pnpm --Framework net10.0

Every template ships with a .cratis/ai.json describing its Cratis AI configuration — the AI profiles, languages, and coding agent harnesses for that template. Right after scaffolding, set your coding agents up with it:

  1. Make sure the Cratis CLI is installed — see cratis.io/cli for install options (Homebrew and the .NET global tool).
  2. From the project root, run:
Terminal window
cratis ai update

This installs the Cratis-owned AI rules, skills, and harness integration for the coding agents you selected — 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 along with your project so your whole team shares the same guidance.

dotnet new prints this same reminder after scaffolding. Re-run cratis ai update whenever you want the latest guidance — it only touches Cratis-managed files, never yours.

Every template ships a docker-compose.yml with a local Chronicle development container (MongoDB bundled) and an Aspire dashboard:

Terminal window
docker-compose up -d

For the web templates, restore frontend dependencies and start the backend:

Terminal window
npm install
dotnet run

The backend serves Swagger at http://localhost:5000/swagger, and the React frontend runs on the Vite dev server (npm run dev, port 5173). Append a command and watch the event land in Chronicle — then open the Workbench at https://localhost:35000 (accept the self-signed development certificate) to see the log.

Terminal window
dotnet new update

updates every installed template package. Uninstall with dotnet new uninstall Cratis.Templates.