Getting started with the Cratis templates
Everything you need is one NuGet package: Cratis.Templates. Install it once per machine:
dotnet new install Cratis.TemplatesTo install a specific version:
dotnet new install Cratis.Templates::1.2.0See what is available
Section titled “See what is available”List the templates and their short names:
dotnet new cratisYou should see the four Cratis templates alongside the built-in .NET templates. Each template has its own help page with every option:
dotnet new cratis -hTwo 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:
dotnet new install Cratis.Templates # the .NET SDK path — needs the SDK installedcratis new # the CLI path — no .NET SDK required at allcratis 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.
cratis new # list the four templatescratis new cratis -n MyStore # scaffold — same parameters as dotnet newcratis new cratis -n MyStore --packageManager pnpm --Framework net10.0No 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.
Scaffold your first application
Section titled “Scaffold your first application”The cratis template creates a complete full-stack application — ASP.NET Core backend with Arc, Chronicle event sourcing, and a React frontend:
dotnet new cratis -n MyStorecd MyStoreThe 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:
dotnet new cratis -n MyStore --packageManager pnpm --Framework net10.0Set up AI assistance
Section titled “Set up AI assistance”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:
- Make sure the Cratis CLI is installed — see cratis.io/cli for install options (Homebrew and the .NET global tool).
- From the project root, run:
cratis ai updateThis 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.
Start the infrastructure
Section titled “Start the infrastructure”Every template ships a docker-compose.yml with a local Chronicle development container (MongoDB bundled) and an Aspire dashboard:
docker-compose up -dRun it
Section titled “Run it”For the web templates, restore frontend dependencies and start the backend:
npm installdotnet runThe 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.
Keep the templates current
Section titled “Keep the templates current”dotnet new updateupdates every installed template package. Uninstall with dotnet new uninstall Cratis.Templates.