Skip to content

Blocks

Blocks are the interactive building components that make Atuin Desktop runbooks come alive. They're executable elements designed specifically for operations and automation workflows.

What are Blocks?

Just as document editors let you embed interactive elements, Atuin Desktop blocks let you embed executable components into your runbooks. The key difference? Our blocks execute real commands, query live databases, and automate workflows - built specifically for DevOps, SRE, and operations teams.

From Static to Interactive

Traditional documentation:

1. SSH to the server: ssh user@prod-server
2. Check disk usage: df -h
3. Query the database: SELECT COUNT(*) FROM users;

Atuin Desktop runbook:

  • SSH Block - Actually connects to your server
  • Terminal Block - Runs df -h and shows real output
  • PostgreSQL Block - Executes the query and displays results in a table

How Blocks Work Together

Blocks in a runbook share context and can pass data between each other, creating powerful automation workflows.

Contextual Blocks

These blocks set the environment and context for subsequent blocks:

  • Directory Block - Sets the working directory for all following blocks
  • Environment Block - Defines environment variables
  • Variable Block - Creates template variables for reuse

Cascading Context

When you set a directory with a Directory block, all subsequent Script, Terminal, and other executable blocks will run in that directory automatically.

Executable Blocks

These blocks perform actions, run commands, or retrieve data:

  • Script Block - Executes code in various languages (bash, python, node)
  • Terminal Block - Provides interactive terminal sessions
  • Database Blocks - Query and manipulate databases
  • HTTP Block - Make API requests and web calls

Template Variables

Blocks can capture output as variables and share data:

# A Script block captures server info
{{var.server_status}} 

# An HTTP block uses that data  
POST /alerts with body: {"server": "{{var.server_status}}"}

Block Examples

Terminal Block

Perfect for interactive debugging and exploration:

# Check system resources
top -n 1
free -h
df -h

Script Block

Non-interactive execution with output capture for automation:

# Check system status and capture output as variable
echo "System: $(uname -s)"
echo "Load: $(uptime | awk -F'load average:' '{print $2}')"
echo "Memory: $(free -m | awk 'NR==2{printf "%.1f%%", $3*100/$2}')"
echo "Disk: $(df -h / | awk 'NR==2{print $5}')"

Output gets saved to a variable and can be referenced in other blocks as {{var.system_status}}

PostgreSQL Block

Query your databases directly in your runbooks:

SELECT 
    table_name,
    pg_size_pretty(pg_total_relation_size(table_name::regclass)) as size
FROM information_schema.tables 
WHERE table_schema = 'public'
ORDER BY pg_total_relation_size(table_name::regclass) DESC;

Directory Block

Set context for file operations:

/var/log/myapp

Then all subsequent blocks run in that directory automatically.

Block Categories

  • Database Blocks


    Connect to and query MySQL, PostgreSQL, ClickHouse, and SQLite databases directly from your runbooks.

    Explore Database Blocks

  • Executable Blocks


    Run scripts, execute commands, manage environments, and automate workflows with powerful execution blocks.

    Explore Executable Blocks

  • Network Blocks


    Make HTTP requests, establish SSH connections, and interact with remote systems and APIs.

    Explore Network Blocks

  • Monitoring Blocks


    Query monitoring systems like Prometheus and integrate real-time metrics into your runbooks.

    Explore Monitoring Blocks

Getting Started with Blocks

  1. Create a block - Type / anywhere in your runbook to open the block picker
  2. Configure the block - Fill in connection details, queries, or commands
  3. Use template variables - Make blocks dynamic with {{var.name}} syntax
  4. Chain blocks together - Use output from one block as input to another
  5. Run your workflow - Execute individual blocks or run the entire runbook