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 -hand 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:
Block Examples
Terminal Block
Perfect for interactive debugging and exploration:
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:
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.
-
Executable Blocks
Run scripts, execute commands, manage environments, and automate workflows with powerful execution blocks.
-
Network Blocks
Make HTTP requests, establish SSH connections, and interact with remote systems and APIs.
-
Monitoring Blocks
Query monitoring systems like Prometheus and integrate real-time metrics into your runbooks.
Getting Started with Blocks
- Create a block - Type
/anywhere in your runbook to open the block picker - Configure the block - Fill in connection details, queries, or commands
- Use template variables - Make blocks dynamic with
{{var.name}}syntax - Chain blocks together - Use output from one block as input to another
- Run your workflow - Execute individual blocks or run the entire runbook