Spry LogoOpsfolio
Reference GuidesCLI

rb

Complete reference for spry runbook command-line tools

Runbook Commands

Spry Runbook (rb) Commands provide the interface for executing tasks and running workflows in Spry.

Root Command

spry rb [OPTIONS]
spry rb [COMMAND] [OPTIONS]

Options:

-h, --help - Show this help.

Commands

ls - List code cells (tasks) in markdown documents.

spry rb ls [OPTIONS] [PATHS...]

Arguments:

  • PATHS - Path(s) to Markdown file(s) (defaults to Spryfile.md)

Options:

  • --no-color - Show output without using ANSI colors

Examples:

spry rb ls

List all tasks in the current directory.

spry rb ls Spryfile.md

List tasks from a specific file.

spry rb ls *.md

List tasks from all markdown files.

spry rb ls --no-color

Output without ANSI colors.


Engine Types:

EngineDescription
shebangExecutable via shebang (shell scripts, python, etc.)
deno-taskDeno task runner
using:<name>External reference to a catalog-defined resource

task - Execute a specific cell and its dependencies.

spry rb task [OPTIONS] <TASK_ID> [PATHS...]

Arguments:

  • TASK_ID - The task identity to execute
  • PATHS - Path(s) to Markdown file(s)

Arguments:

  • TASK_ID - The task identity to execute
  • PATHS - Path(s) to Markdown file(s)

Options:

OptionDescription
--verbose <style>Emit information messages verbosely (plain, rich, markdown)
--summarizeEmit summary after execution in JSON

Examples:

spry rb task task-1

Run a specific task.

spry rb task task-1 --verbose rich

Run with detailed colored output.

spry rb task task-1 --summarize

Run with JSON summary of results.

spry rb task task-1 --verbose rich --summarize

Run with all options enabled.


run - Execute all code cells in markdown documents as a DAG (Directed Acyclic Graph).

spry rb run [OPTIONS] [PATHS...]

Arguments:

  • PATHS - Path(s) to Markdown file(s)

Options:

  • -h, --help - Show help information
  • --verbose <style> - Emit information messages verbosely
    • plain - Plain text output
    • rich - Colorized/formatted output
    • markdown - Markdown formatted output
  • --graph <name> - Run only nodes in provided graph(s)
  • --summarize - Emit summary after execution in JSON format
  • --visualize <style> - Visualize the DAG before/during execution
    • ascii-tree - Tree structure diagram
    • ascii-workflow - Workflow sequence diagram
    • ascii-flowchart - Detailed flowchart format
    • mermaid-js - Mermaid graph syntax

Examples:

# Run all tasks in order
spry rb run

# Run from specific file
spry rb run Spryfile.md
# Plain text output
spry rb run --verbose plain

# Colored detailed output
spry rb run --verbose rich

# Markdown formatted output
spry rb run --verbose markdown
# Run only Graph A tasks
spry rb run --graph A

# Run Graphs A and B
spry rb run --graph "A,B"
# Show task tree structure
spry rb run --visualize ascii-tree

# Show workflow sequence
spry rb run --visualize ascii-workflow

# Show detailed flowchart
spry rb run --visualize ascii-flowchart

# Show Mermaid diagram
spry rb run --visualize mermaid-js
# JSON execution summary
spry rb run --summarize

# Output with visualization
spry rb run --verbose rich --visualize ascii-workflow

# Save execution log
spry rb run --verbose rich --summarize > execution.json

issues - Display any issues (errors, warnings, etc.) in the mdast nodes.

spry rb issues [PATHS...]

Arguments:

  • PATHS - Path(s) to Markdown file(s)

What It Detects:

  • Malformed code block syntax
  • Invalid task IDs
  • Circular dependencies
  • Missing task references
  • Duplicate task names
  • Syntax errors

Examples:

# Check current file
spry rb issues

# Check specific file
spry rb issues Spryfile.md

# Check all markdown files
spry rb issues *.md

Output:

No Issues:

✓ No issues found

With Issues:

Spryfile.md:
  Line 42: ERROR - Circular dependency: task-a → task-b → task-a
  Line 58: WARNING - Undefined task reference 'missing-task'
  Line 75: ERROR - Missing language specifier in code block

Usage Patterns:

  1. Validate Before Running
spry rb issues && spry rb run
  1. In Scripts
if spry rb issues > /dev/null; then
  echo "Ready to run"
  spry rb run
else
  echo "Fix issues first"
fi

Always run spry rb issues before executing tasks to catch potential problems early.


tap - Execute all code cells and return results in TAP (Test Anything Protocol) format.

spry rb tap [OPTIONS] [PATHS...]

Arguments:

  • PATHS - Path(s) to Markdown file(s)

Options:

OptionDescription
--style <style>Output format: canonical (default), html, markdown, json
--save <path>Save output to a file instead of printing to STDOUT
--graph <name>Execute only nodes belonging to the specified graph. May be repeated.
--verbose <style>Emit information messages verbosely (plain, rich)

Output Styles:

StyleDescription
canonicalStandard TAP v14 text output
htmlHTML formatted report (great for browsers and sharing)
markdownMarkdown formatted report
jsonStructured JSON output

Examples:

# Run and print TAP to terminal
spry rb tap runbook.md

Execute runbook and output standard TAP format.

# Generate Markdown TAP report
spry rb tap runbook.md --style markdown

# Generate HTML report for browser viewing
spry rb tap runbook.md --style html

# Generate JSON output
spry rb tap runbook.md --style json
# Write the output to a file 
spry rb tap runbook.md --save report.tap

# Save report as JSON
spry rb tap runbook.md --style json --save report.json

# Save HTML report
spry rb tap runbook.md --style html --save test.tap.html
# Run only a specific graph
spry rb tap --graph rowcounts runbook.md

# Run multiple graphs
spry rb tap --graph "A,B" runbook.md
# Run graph and save HTML report
spry rb tap --graph rowcounts --style html --save test.tap.html

# Verbose execution with JSON output
spry rb tap --verbose rich --style json runbook.md

Use Cases:

Use CaseRecommendation
CI pipelines--style json or canonical
Human review--style html or markdown
Auditing / QA--style markdown
Programmatic parsing--style json

The tap command executes all code cells as a DAG and produces standards-compliant TAP output, making it ideal for validation, automation, and reporting workflows.

Related Commands:

For full diagnostics with execution context and details, use:

spry rb report > report.md
spry rb report --graph rowcounts > report.rowcounts.md

report - Execute all code cells and return as new markdown with outputs embedded.

spry rb report [OPTIONS] [PATHS...]

Arguments:

  • PATHS - Path(s) to Markdown file(s)

Options:

OptionDescription
--graph <name>Run only the nodes in provided graph(s). May be repeated.

Examples:

# Generate report from current directory
spry rb report

# Generate report from specific file
spry rb report Spryfile.md

# Generate reports from multiple files
spry rb report *.md

# Generate reports and save the response to a file
spry rb report file.md > executed-runbook.md
Output Example

Before:

```bash
echo "Hello"
```

After:

```bash
echo "Hello"
```
```output
Hello
```

The report command will execute all code cells. Ensure your code is safe to run before generating reports.

File Sources

All commands that accept file paths support:

  1. Local file system paths: ./Spryfile.md, /path/to/file.md
  2. Default behavior: If no path is provided, uses Spryfile.md in the current directory
  3. Multiple sources: Some commands support multiple file paths

How is this guide?

Last updated on

On this page