# Overview

Learn about the template format and how templates work.

Templates are JSON5 files that automate project setup and configuration. A template declares [options](/reference/cli/templates/options) for user input, then runs a sequence of [actions](/reference/cli/templates/actions) that can install dependencies, create resources, download files, prompt the user, and more.

## Example

Here is a template that checks for a framework, installs dependencies, and prints a confirmation:

**template.json5**

```json5
{
  "$schema": "https://schema.croct.com/json/v1/template.json",
  "title": "Quick start",
  "description": "Sets up the project with the Croct SDK.",
  "options": {
    "typescript": {
      "type": "boolean",
      "description": "Whether to use TypeScript.",
      "default": true
    }
  },
  "actions": [
    {
      "name": "check-dependency",
      "dependencies": [
        {
          "name": "next"
        }
      ]
    },
    {
      "name": "install"
    },
    {
      "name": "integrate-croct"
    },
    {
      "name": "print",
      "semantics": "success",
      "message": "You're all set!"
    }
  ]
}
```

To apply this template, run:

```sh
croct use template.json5
```

For the full list of top-level properties, see the [template file](/reference/cli/templates/structure) reference.

## Concepts

- **[Options](/reference/cli/templates/options)** are typed parameters the template accepts as input. The CLI prompts for any required options not provided via flags.
- **[Expressions](/reference/cli/templates/expressions)** are dynamic values using the `${...}` syntax, with access to [variables](/reference/cli/templates/variables), [functions](/reference/cli/templates/functions), and operators.
- **[Actions](/reference/cli/templates/actions)** are the steps a template performs, from installing dependencies to creating files. See the [action reference](/reference/cli/templates/actions) for the full list.

## Sources

Templates can be loaded from local files, URLs, npm packages, and registries:

```sh
croct use croct://starter/nextjs
```

See [sources](/reference/cli/templates/sources) for all supported formats.

## Publishing

To scaffold a new template, use the [`create template`](/reference/cli/commands/create-template) command. For details on sharing templates, see the [publishing templates tutorial](/immersion/tutorials/template-publishing).

## Explore

- [Template structure](/reference/cli/templates/structure): Learn about the template file format.
- [Actions](/reference/cli/templates/actions): Browse all available template actions.
- [Expressions](/reference/cli/templates/expressions): Learn how to use dynamic values in templates.
- [Use](/reference/cli/commands/use): Learn how to apply a template to your project.
