Variables Reference
Complete AgileBuilder variable types reference
Overview
This document is the complete reference for all variable types supported by AgileBuilder.
Variable Types
string
String variables, used for project names, package names, ports, etc.
{
"name": "projectName",
"type": "string",
"description": "Project name",
"required": true,
"default": "my-app",
"pattern": "^[a-z][a-z0-9-]*$",
"patternMessage": "Project name must start with a letter and contain only lowercase letters, numbers, and hyphens"
}
| Property | Type | Description |
|---|---|---|
name | string | Variable name, required |
type | string | Fixed value: "string" |
description | string | Variable description |
required | boolean | Whether required, defaults to false |
default | string | Default value |
pattern | string | Regex validation pattern |
patternMessage | string | Message when validation fails |
boolean
Boolean variables, used to enable or disable certain features.
{
"name": "useTypeScript",
"type": "boolean",
"description": "Enable TypeScript",
"default": true
}
| Property | Type | Description |
|---|---|---|
name | string | Variable name, required |
type | string | Fixed value: "boolean" |
description | string | Variable description |
default | boolean | Default value |
select
Single-select variable, choose one from predefined options.
{
"name": "framework",
"type": "select",
"description": "Select frontend framework",
"options": ["react", "vue", "svelte"],
"default": "react"
}
| Property | Type | Description |
|---|---|---|
name | string | Variable name, required |
type | string | Fixed value: "select" |
description | string | Variable description |
options | string[] | List of options, required |
default | string | Default option |
required | boolean | Whether required, defaults to false |
multiselect
Multi-select variable, choose multiple from predefined options.
{
"name": "features",
"type": "multiselect",
"description": "Select feature modules",
"options": ["eslint", "prettier", "husky", "jest", "cypress"],
"default": ["eslint", "prettier"]
}
| Property | Type | Description |
|---|---|---|
name | string | Variable name, required |
type | string | Fixed value: "multiselect" |
description | string | Variable description |
options | string[] | List of options, required |
default | string[] | Default options list |
min | number | Minimum selections |
max | number | Maximum selections |
JSON Schema
Complete variable definition JSON Schema:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"definitions": {
"baseVariable": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"required": { "type": "boolean" }
},
"required": ["name"]
},
"stringVariable": {
"allOf": [
{ "$ref": "#/definitions/baseVariable" },
{
"type": "object",
"properties": {
"type": { "const": "string" },
"default": { "type": "string" },
"pattern": { "type": "string" },
"patternMessage": { "type": "string" }
}
}
]
},
"booleanVariable": {
"allOf": [
{ "$ref": "#/definitions/baseVariable" },
{
"type": "object",
"properties": {
"type": { "const": "boolean" },
"default": { "type": "boolean" }
}
}
]
},
"selectVariable": {
"allOf": [
{ "$ref": "#/definitions/baseVariable" },
{
"type": "object",
"properties": {
"type": { "const": "select" },
"options": {
"type": "array",
"items": { "type": "string" }
},
"default": { "type": "string" }
},
"required": ["options"]
}
]
},
"multiselectVariable": {
"allOf": [
{ "$ref": "#/definitions/baseVariable" },
{
"type": "object",
"properties": {
"type": { "const": "multiselect" },
"options": {
"type": "array",
"items": { "type": "string" }
},
"default": {
"type": "array",
"items": { "type": "string" }
},
"min": { "type": "number" },
"max": { "type": "number" }
},
"required": ["options"]
}
]
}
}
}
Usage Examples
Complete Configuration Example
{
"variables": [
{
"name": "projectName",
"type": "string",
"description": "Project name (used for directory and package names)",
"required": true,
"pattern": "^[a-z][a-z0-9-]*$",
"patternMessage": "Only lowercase letters, numbers, and hyphens allowed"
},
{
"name": "framework",
"type": "select",
"description": "Select frontend framework",
"options": ["react", "vue", "svelte"],
"default": "react"
},
{
"name": "useTypeScript",
"type": "boolean",
"description": "Enable TypeScript",
"default": true
},
{
"name": "extraFeatures",
"type": "multiselect",
"description": "Additional features",
"options": ["eslint", "prettier", "husky", "jest"],
"default": ["eslint", "prettier"]
}
]
}
Next Steps
- Handlebars Syntax - Learn how to use variables in templates
- Template Getting Started - Learn to create templates