---
title: Getting started with the Cratis templates
description: Install the Cratis.Templates package and scaffold your first event-sourced application.
---


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

```bash
dotnet new install Cratis.Templates
```

To install a specific version:

```bash
dotnet new install Cratis.Templates::1.2.0
```

## See what is available

List the templates and their short names:

```bash
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:

```bash
dotnet new cratis -h
```

## Two ways to scaffold: dotnet new and cratis new

The templates work unchanged through both doors:

```bash
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.

```bash
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](https://cratis.io/cli/new/)
for the full command reference, the `--allow-scripts` contract, and how the two template stores
stay isolated from each other.

## 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:

```bash
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:

```bash
dotnet new cratis -n MyStore --packageManager pnpm --Framework net10.0
```

## 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:

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

```bash
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.

## Start the infrastructure

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

```bash
docker-compose up -d
```

## Run it

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

```bash
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.

## Keep the templates current

```bash
dotnet new update
```

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