LogoLogo
Home
Atuin Docs
Atuin Docs
  • Welcome
  • Getting Started
    • Runbook Basics
  • Blocks
    • Executable
      • Terminal
      • Script
      • Directory
      • Env
    • Network
      • HTTP
      • SSH
    • Databases
      • PostgreSQL
      • SQLite
      • Clickhouse
    • Monitoring
      • Prometheus
  • Templating
  • Secrets
  • Atuin Hub
    • Getting Started
    • Sharing Runbooks
    • Collaborative Editing
Powered by GitBook
On this page

Templating

PreviousPrometheusNextSecrets

Last updated 3 months ago

Templates

Atuin uses for rendering templates, enabling flexible output customization.

Basic Syntax

  • Variables: {{ var.variable_name }}

    • Variables can be set by Script blocks

  • Filters: {{ text | upper }}, {{ list | join(", ") }}

  • Conditionals:

    {% if var.foo %}
    echo "foo is true"
    {% else %}
    echo "foo is false"
    {% endif %}
  • Loops:

    {% for remote in ["192.168.1.1", "192.168.1.2"] %}
    echo "{{ remote }}"
    {% endfor %}

Built-in Functions

  • range(n): Generates a sequence → {% for i in range(3) %}{{ i }}{% endfor %}

  • length(list): Gets list length → {{ length(users) }}

  • default(value, fallback): Uses fallback if None → {{ user.name | default("Guest") }}

Document access

The template system has full access to the entire document - blocks, text, etc.

We are still iterating on this API, and it is likely to change in future releases

First, give a block a name. Click the pencil icon next to the default name in the top left.

Then, it can be referred to via the {{ doc.named }}map, within the template system

MiniJinja