Template file

Reference for the template file format.

A template is a JSON5 (or plain JSON) file that defines metadata, parameters, and actions. You can scaffold one using the create template command.

Example

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

template.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(optional)
string

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(optional)
Record<string,Option>

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.

actions
Array<Action>

The steps that the template executes in order.

For the full list, see the Action reference.

metadata(optional)
object

Metadata about the template.

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