The terox.json manifest
Full reference for the manifest file that declares your template's variables.
terox.json declares the variables a template needs. It lives at the root
of the template directory and is read by Terox at scaffold time.
Schema
{
"name": "Example Template",
"description": "Optional human-readable description.",
"variables": [
{
"name": "project_name",
"prompt": "Project name",
"default": "my-project"
}
]
}
Top-level fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | Human-readable name shown in tool output. |
description | string | no | Free-form description of what the template scaffolds. |
variables | object | no | Variables Terox will prompt for. Order is preserved. |
If variables is missing or empty, no prompts are shown and the template
is rendered with no substitutions.
Variable fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Identifier referenced inside templates as {{.name}}. Must be unique. |
prompt | string | no | Question shown to the user. Defaults to name if omitted. |
default | string | no | Default value if the user accepts the prompt or runs in --non-interactive mode. |
type | string | no | "string" (default) or "bool". Booleans render a yes/no prompt and resolve to "true"/"false". |
choices | string | no | If present, the prompt becomes a select list. The default must be one of the choices. |
Examples
Plain string with a default
{ "name": "project_name", "prompt": "Project name", "default": "my-project" }
Single-choice select
{
"name": "license",
"prompt": "License",
"default": "MIT",
"choices": ["MIT", "Apache-2.0", "GPL-3.0", "None"]
}
Boolean
{
"name": "use_typescript",
"prompt": "Use TypeScript?",
"type": "bool",
"default": "true"
}
In templates, the rendered value is the string "true" or "false":
{{if eq .use_typescript "true"}}tsconfig.json{{end}}
Validation rules
- Every variable must have a
name. - In
--non-interactivemode, every variable must either be supplied via--set name=valueor have a non-emptydefault(booleans always resolve, choices fall back to the first option). - Choice variables in interactive mode show only the values in
choices; in non-interactive mode any--setvalue is accepted as a string (a future release will tighten this).