Skip to main content

Installation

The sirenspec CLI is installed automatically when you add the package:
After installation, the sirenspec command is available on your PATH. You can also check the installed version:

sirenspec init

Scaffold a new workflow interactively. Prompts for a template and provider, then writes a workflow.yaml and .env.example in the target directory. The generated workflow passes sirenspec validate immediately.
Options: Exit codes: Example session:

sirenspec run

Execute a workflow and display the results. By default, node execution is rendered with Rich formatting to the terminal (streaming per-node view). Use --trace or --output json to output the full JSON execution trace instead.
Arguments: Options: Exit codes: Examples:
Streaming Output Format: When run in a TTY without --trace or --output json, the CLI renders each completed node as a Rich panel:
For swarm nodes (type: swrm), the output shows a dedicated parallel execution block:
When synthesis is configured, its output is shown in a final panel after the swarm footer. If any agent fails, the footer shows the failure count (e.g., 2/3 succeeded, 1 failed). Failed agents display their error message in a red-bordered panel. JSON Trace Format: When --trace, --output json, or --trace-file is used, the full execution trace is written as JSON:
Trace fields:

sirenspec explain

Print a human-readable execution plan for a workflow without making any LLM calls.
Arguments: Options: Exit codes: Examples:
Text Output Format: The text format shows the execution order, node types, guardrails, and edges in a human-readable table:
JSON Output Format: The JSON format is useful for integration into CI/CD systems or analysis tools:

sirenspec test

Discover and run YAML test fixtures. Each fixture file (*.test.yaml) contains a workflow definition plus a set of assertions that are validated during execution.
Arguments: Options: Exit codes: Examples:
Output format: For each fixture, a per-fixture result is printed:
After all fixtures, a summary line is printed:

sirenspec validate

Validate a workflow YAML file without executing it or making any API calls.
Arguments: Exit codes: Examples:
What is validated:
  • YAML syntax (including duplicate key detection).
  • Required fields (version, agents, nodes).
  • Agent fields (model, system).
  • Node fields (agent, writes).
  • Edge references — all from and to values must refer to existing nodes.
  • Node agent references — all agent values must refer to existing agents.
After model validation, a static template linter runs over every template-bearing field (agent/swrm/synthesis prompts, factory/workflow inputs, for_each, swarm_size): Errors raise WorkflowLintError and fail validation; warnings are printed without blocking. The same linter runs inside load_workflow() before any LLM call is made. Provider credentials and when: expressions are not evaluated during validation.

sirenspec render

Render a workflow as a diagram without executing it or making any API calls.
Arguments: Options: Exit codes: Examples:
Output format: The mermaid target produces a graph TD flowchart. Unconditional edges are plain arrows; conditional edges are labeled with their when: expression.
Paste this into any Mermaid renderer (GitHub markdown, Mermaid Live Editor, etc.) to visualise the workflow graph.