# Template file

Reference for the template file format.

A template is a [JSON5](https://json5.org) (or plain JSON) file that defines metadata, parameters, and actions. You can scaffold one using the [`create template`](/reference/cli/commands/create-template) command.

## Example

The following template accepts a boolean option and runs two actions:

**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": "install"
    },
    {
      "name": "integrate-croct"
    }
  ]
}
```

## Properties

The following list describes the top-level properties of a template file:

- `$schema`: `string` (optional)

  The URL of the JSON Schema for validation and autocomplete in editors.

  Set this to `https://schema.croct.com/json/v1/template.json` to get autocomplete and validation in editors that support JSON Schema.

- `title`: `string`

  The title of the template.

  This value is displayed when the template is applied, helping users understand what the template does before confirming execution.

- `description`: `string`

  A short description of what the template does.

  This value is displayed alongside the title when the template is applied.

- `options`: `Record<string, Option>` (optional) (see [Option](/reference/cli/templates/options))

  The parameters that the template accepts.

  Option names must start with a letter or digit and can contain letters, digits, hyphens, and underscores.

  For more details, see [Options](/reference/cli/templates/options).

- `actions`: `Array<Action>` (see [Action](/reference/cli/templates/actions))

  The steps that the template executes in order.

  For the full list, see the [Action reference](/reference/cli/templates/actions).

- `metadata`: `object` (optional)

  Metadata about the template.

  This property is reserved for tooling and registry use. It is not used during template execution.

## Explore

- [Actions](/reference/cli/templates/actions): Browse all available template actions.
- [Variables](/reference/cli/templates/variables): Explore the built-in template variables.
- [Expressions](/reference/cli/templates/expressions): Learn how to use dynamic values in templates.
- [Functions](/reference/cli/templates/functions): Explore the built-in template functions.
