Radiator Server Documentation — v10.33.3

Template Rendering CLI

Generate configuration files from templates using the command line

Table of Contents
  • Usage
  • Template File Format
  • Values File Format
  • Template Syntax
  • Variable Substitution
  • Missing Variables
  • Example
  • Exit Codes
  • Error Handling

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 [--no-header] <TEMPLATE_FILE> <VALUES_FILE> [OUTPUT_FILE]
radiator template verify <TEMPLATE_FILE> [GENERATED_FILE]
ArgumentDescription
TEMPLATE_FILEPath to the template file (.radtmpl)
VALUES_FILEPath to a JSON file containing template values
OUTPUT_FILEPath where the rendered output is written (optional)
GENERATED_FILEPath to a rendered configuration file to verify (optional)
--no-headerOmit the generated-template metadata header from render output

When OUTPUT_FILE is omitted, the rendered output is written to stdout.

By default, the command prepends the same generated-template metadata header that Management UI adds when it creates a configuration from a template. The header records the source template filename, the template checksum, and the values used for rendering. Management UI uses this metadata to recognize generated configuration files and reopen them through the template form.

Use --no-header when a script needs only the rendered template body.

Use radiator template verify to validate template files before rendering them. When only TEMPLATE_FILE is provided, the command verifies that the template has valid metadata and valid Handlebars syntax.

When GENERATED_FILE is also provided, the command verifies that the generated file starts with generated-template metadata, that the recorded template checksum matches the current template content, and that the generated file still matches the rendering result for the values stored in its metadata.

Template File Format

Template files use the .radtmpl extension and contain two sections separated by marker lines:

  1. Metadata section: JSON object defining template fields and their types
  2. 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 with a generated-template metadata header followed by the rendered body:

# radiator-interpolated-config-template { ... }
# NOTE: This file has been automatically generated from a template file at backend.radtmpl.
#
# The file was generated with the following template values:
# - Backend name: production_backend
# - Secret: prod_secret_456
# - Debug mode: false
#
# Any manual changes to the below configuration will be lost if the template values are
# edited via the management UI. You can disable the management UI template form for
# this configuration file by removing the radiator-interpolated-config-template comment
# on the first line.

backends {
  file "production_backend" {
    secret "prod_secret_456";
  }
}

To produce the previous body-only output, run:

radiator template render --no-header backend.radtmpl values.json output.radconf

This produces:

backends {
  file "production_backend" {
    secret "prod_secret_456";
  }
}

To output to stdout instead:

radiator template render backend.radtmpl values.json

Stdout output also includes the generated-template metadata header by default. Use --no-header with stdout when you need only the rendered body.

If you want Management UI to reopen the generated file through the template form, pass TEMPLATE_FILE as the same relative template path that Management UI uses. For example, from the configured template directory, use backend.radtmpl or subdir/backend.radtmpl rather than an unrelated absolute path.

To verify a template before rendering it, run:

radiator template verify backend.radtmpl

To verify that a generated configuration still matches its source template and metadata, run:

radiator template verify backend.radtmpl output.radconf

Exit Codes

CodeMeaning
0Success
1Error (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
  • The template metadata is missing or invalid
  • The generated file does not contain generated-template metadata on the first line
  • The generated file checksum does not match the current template content
  • The generated file content no longer matches the rendering result
Navigation
  • About Radiator software development security

  • Architecture Overview

  • Backend Load Balancing

  • Basic Installation

  • Built-in Environment Variables

  • Comparison Operators

  • Configuration Editor

  • Configuration Import and Export

  • Containers

  • Data Types

  • Duration Units

  • Environment Variables

  • Execution Context

  • Execution Pipelines

  • Filters

  • Getting a Radiator License

  • Health check /live and /ready

  • High Availability and Load Balancing

  • High availability identifiers

  • HTTP Basic Authentication

  • Introduction

  • Linux systemd support

  • Local AAA Backends

  • Log storage and formatting

  • Management API privilege levels

  • Namespaces

  • Password Hashing

  • 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

  • Service Level Objective

  • TACACS+ Authentication, Authorization, and Accounting

  • Template Rendering CLI

  • Tools radiator-client

  • TOTP/HOTP Authentication

  • What is Radiator?

  • YubiKey Authentication

  • YubiKey Context Variables