Template Rendering CLI
Generate configuration files from templates using the command line
Radiator provides a CLI subcommand for rendering configuration templates outside of the management UI. This enables automated configuration generation in deployment pipelines, scripted provisioning, or batch processing scenarios.
Usage
radiator template render <TEMPLATE_FILE> <VALUES_FILE> [OUTPUT_FILE]
| Argument | Description |
|---|---|
TEMPLATE_FILE | Path to the template file (.radtmpl) |
VALUES_FILE | Path to a JSON file containing template values |
OUTPUT_FILE | Path where the rendered output is written (optional) |
When OUTPUT_FILE is omitted, the rendered output is written to stdout.
Template File Format
Template files use the .radtmpl extension and contain two sections separated by marker lines:
- Metadata section: JSON object defining template fields and their types
- Template body: Handlebars-style template content
# radiator-config-template
{
"description": "Example backend configuration",
"items": [
{
"id": "BACKEND_NAME",
"label": "Backend name",
"type": "string"
},
{
"id": "SECRET",
"label": "Shared secret",
"type": "string"
},
{
"id": "ENABLE_DEBUG",
"label": "Enable debug logging",
"type": "boolean"
}
]
}
# radiator-config-template
backends {
file "{{{BACKEND_NAME}}}" {
secret "{{{SECRET}}}";
{{#if ENABLE_DEBUG}}
debug true;
{{/if}}
}
}
Values File Format
The values file is a JSON object where keys match the id fields defined in the template metadata:
{
"BACKEND_NAME": "my_backend",
"SECRET": "supersecret123",
"ENABLE_DEBUG": true
}
Template Syntax
The template body uses Handlebars syntax for variable substitution and control flow.
Variable Substitution
Use triple braces {{{variable}}} to insert values without HTML escaping (recommended for configuration files):
secret "{{{SECRET}}}";
Double braces {{variable}} apply HTML escaping, which is typically not needed for configuration files.
Missing Variables
Missing variables render as empty strings, allowing partial value sets during development or preview.
Example
Given the template file backend.radtmpl:
# radiator-config-template
{
"description": "File backend configuration",
"items": [
{"id": "NAME", "label": "Backend name", "type": "string"},
{"id": "SECRET", "label": "Secret", "type": "string"},
{"id": "DEBUG", "label": "Debug mode", "type": "boolean"}
]
}
# radiator-config-template
backends {
file "{{{NAME}}}" {
secret "{{{SECRET}}}";
{{#if DEBUG}}
debug true;
{{/if}}
}
}
And values file values.json:
{
"NAME": "production_backend",
"SECRET": "prod_secret_456",
"DEBUG": false
}
Running:
radiator template render backend.radtmpl values.json output.radconf
Produces output.radconf:
backends {
file "production_backend" {
secret "prod_secret_456";
}
}
To output to stdout instead:
radiator template render backend.radtmpl values.json
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (missing file, invalid JSON, template error) |
Error Handling
The command fails with an error message when:
- The template file does not exist or cannot be read
- The values file does not exist or contains invalid JSON
- The output file cannot be written (when specified)
- The template contains syntax errors
Architecture Overview
Backend Load Balancing
Basic Installation
Comparison Operators
Configuration Editor
Configuration Import and Export
Data Types
Duration Units
Execution Context
Execution Pipelines
Filters
Health check /live and /ready
High Availability and Load Balancing
High availability identifiers
HTTP Basic Authentication
Introduction
Local AAA Backends
Log storage and formatting
Management API privilege levels
Namespaces
Password Hashing
Pipeline Directives
Probabilistic Sampling
Prometheus scraping
PROXY Protocol Support
Radiator server health and boot up logic
Radiator sizing
Radiator software releases
Rate Limiting
Rate Limiting Algorithms
Reverse Dynamic Authorization
Template Rendering CLI
Tools radiator-client
TOTP/HOTP Authentication
What is Radiator?