---
title: Create projects with Forge templates
description: Discover and use Forge templates, then run tests in the generated application.
moved_from:
  - reference/tools/project-templates.md
---

# Create projects with Forge templates

<a id="project-templates"></a>
<a id="description"></a>
<a id="why-we-use-it"></a>

Forge templates create an application's starting structure and add capabilities to an existing project. For a first application, follow the [guided tutorial](tutorials/index.md); use this page when you need to discover template options or understand the generated test runner.

## Setup

### Install Production Templates

Follow [SAIF CLI installation](install-saif-cli.md) for NuGet feed access and tool setup. `saif doctor fix` installs or updates the platform tools and templates.

## Creating and Using Templates

### Using SAIF CLI

List templates and inspect the selected template's options before generation:

```powershell
saif new --help
saif new saif-api-exp --help
saif new saif-api-exp --no-publish
```

`--no-publish` keeps generation local. Without it, the normal `saif new` flow also publishes the repository and registers its pipelines. See the [first application tutorial](tutorials/index.md#step-2-create-your-project) for the full journey and [pipeline reference](../reference/pipelines.md) for the resulting pipeline files.

#### Provide parameters upfront

`saif new <template>` prompts for each required parameter. Pass the parameters on the command line to skip the prompts, for example `saif new saif-event-service --name myapp --owner Platform`. Each template's `--help` output and its task guide list the parameters it accepts.

Generation succeeded when the CLI reports that files were generated, prints no errors, and creates the new project folder. Change into that folder with `cd <your-project-name>` before continuing with the template's task guide.

An agent can use Forge MCP's `list_templates` and `get_template` to discover names and parameters without invoking the shell.

### Using dotnet new

The underlying package is `SAIF.Platform.Templates`. For direct .NET template use after configuring the feed:

```powershell
dotnet new install SAIF.Platform.Templates
dotnet new list saif-
dotnet new saif-api-exp --help
```

Review the chosen template's parameters and post-actions before generating. Use `saif new` when you want Forge's publishing workflow; direct `dotnet new` generation does not replace that workflow.

### Post-Generation

Open the generated solution, start its AppHost, and verify the resources in the Aspire dashboard. The [tutorial's local-run steps](tutorials/index.md#step-3-run-locally) cover this sequence.

### Generated project layout

Service templates share a top-level layout. Pipeline file names vary by template: the event service template generates `azure-pipelines.yml`, while API and frontend templates generate one pair per component, such as `azure-pipelines-api.yml` or `azure-pipelines-web.yml`. Each template's task guide describes the folders specific to that service type.

```
your-project/
├── .azdo/                                # Azure Pipelines configuration
│   ├── azure-pipelines[-<component>].yml     # Deployment pipeline
│   ├── azure-pipelines[-<component>]-pr.yml  # Pull request validation pipeline
│   └── vars/                             # Pipeline variables
├── infra/                                # Infrastructure as Code (Terraform)
│   ├── bootstrap/                        # Environment bootstrapping
│   └── <component>/                      # Service infrastructure, e.g. api/, event/, web/
├── src/                                  # Source code
└── .gitignore
```

- **`.azdo/`** holds the PR validation and deployment pipelines; see the [pipeline reference](../reference/pipelines.md).
- **`infra/`** holds the Terraform configuration for the service's Azure resources.
- **`src/`** holds the application, AppHost, and TypeSpec projects the template generates.

### Test Execution: Native Microsoft Testing Platform (MTP)

Follow [Testing](../build/testing/index.md#test-execution-native-microsoft-testing-platform-mtp) for the generated runner configuration, test selectors, coverage command, and prerequisites when adding tests to an older application. That page owns the test-execution instructions.

## Contributor documentation

<a id="links"></a>

Template authoring, composition, and local validation belong in the [repository contributor guide](https://github.com/saif-corp/forge/blob/main/docs/_internal/contributing/project-templates.md), not the application setup path.
