Installation
Thesirenspec CLI is installed automatically when you add the package:
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.
| Option | Short | Description |
|---|---|---|
--output PATH | -o | Directory for the generated files. Defaults to the current working directory. |
| Code | Meaning |
|---|---|
0 | Files were created successfully. |
1 | The generated workflow failed validation (rare — indicates a template bug). |
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.
| Argument | Description |
|---|---|
workflow-file | Path to the workflow YAML file. |
| Option | Short | Description |
|---|---|---|
--input TEXT | -i | User input message. Overrides input.message in the YAML. |
--trace | Print full JSON trace to stdout (disables per-node panels). | |
--output TEXT | Output format. Use "json" for raw JSON trace (equivalent to --trace). | |
--trace-file TEXT | Write full JSON trace to this file path (in addition to streaming output). | |
--quiet | Suppress node panels; print only the summary (useful for non-TTY environments). | |
--no-stream | Disable per-token streaming inside node panels. Panels and summary still render. |
| Code | Meaning |
|---|---|
0 | Workflow completed successfully. |
1 | File not found, validation error, execution error, or guardrail violation. |
--trace or --output json, the CLI renders each completed node as a Rich panel:
type: swrm), the output shows a dedicated parallel execution block:
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:
| Field | Description |
|---|---|
workflow.version | Schema version from the YAML file. |
input.message | The user input that was used. |
nodes | Ordered list of executed nodes. |
nodes[].id | Node identifier. |
nodes[].type | Node type: "agent", "tool", "swrm", "factory", or "workflow". |
nodes[].output | The node’s output value (string, dict, list, or null). |
nodes[].writes | Context path where the output was written. |
nodes[].status | "success", "skipped", or "failed". |
nodes[].skip_reason | Why a node was skipped: "branch_not_taken" (no incoming edge’s when: matched) or "budget_exceeded" (workflow budget exhausted). null for executed nodes. Branch-not-taken nodes are suppressed from the terminal panels but still appear in the JSON trace. |
nodes[].error | Error message if the node failed, otherwise null. |
nodes[].tokens | Total tokens used by this node. |
nodes[].usage | Detailed token usage with prompt_tokens, completion_tokens, total_tokens, and estimated_usd. |
nodes[].guardrails_passed | List of guardrail check methods that succeeded. |
nodes[].duration_ms | Wall-clock time for this node in milliseconds. |
output | Final output context (all output.* paths). |
summary.total_tokens | Sum of tokens across all nodes. |
summary.total_usage | Aggregated token usage with detailed breakdown. |
summary.total_duration_ms | Sum of durations across all nodes. |
summary.status | "success" or "failed". |
summary.budget | Present only when a budget: block is configured. Reports the configured ceilings plus tokens_used, estimated_usd, duration_s, exceeded, violations, and skipped_remaining. See YAML Reference → budget. |
sirenspec explain
Print a human-readable execution plan for a workflow without making any LLM calls.
| Argument | Description |
|---|---|
workflow-file | Path to the workflow YAML file. |
| Option | Short | Description |
|---|---|---|
--format TEXT | -f | Output format: "text" (default) for human-readable or "json" for machine-readable. |
| Code | Meaning |
|---|---|
0 | Plan generated successfully. |
1 | File not found, validation error, or structural errors in the workflow graph. |
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.
| Argument | Description |
|---|---|
test-path | Path to a single test fixture file or a directory of *.test.yaml files. |
| Option | Description |
|---|---|
--mock | Replay LLM responses from a cassette file (no live API calls). Requires --cassette. |
--record | Run live and record LLM responses into a cassette file. Requires --cassette. Mutually exclusive with --mock. |
--cassette PATH | Path to the cassette file for --mock or --record. Required when either is used. |
| Code | Meaning |
|---|---|
0 | All fixtures passed assertions. |
1 | One or more fixtures failed assertions or encountered execution errors. |
2 | Configuration error (e.g., missing --cassette when using --mock). |
sirenspec validate
Validate a workflow YAML file without executing it or making any API calls.
| Argument | Description |
|---|---|
workflow-file | Path to the workflow YAML file. |
| Code | Meaning |
|---|---|
0 | File is valid. |
1 | File not found or validation failed. |
- YAML syntax (including duplicate key detection).
- Required fields (
version,agents,nodes). - Agent fields (
model,system). - Node fields (
agent,writes). - Edge references — all
fromandtovalues must refer to existing nodes. - Node agent references — all
agentvalues must refer to existing agents.
inputs, for_each, swarm_size):
| Rule | Level | Trigger |
|---|---|---|
working_dot_node_id | error (blocks load) | {{ working.<node_id>.* }} where <node_id> is a known node — the canonical form is {{ <node_id>.output }}. |
unknown_namespace | warning | A top-level template name that is neither reserved (inputs, env, item, index, total) nor a known node ID — usually a typo. |
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.
| Argument | Description |
|---|---|
workflow-file | Path to the workflow YAML file. |
| Option | Short | Description |
|---|---|---|
--target TEXT | Render target format. Currently only mermaid is supported. | |
--output TEXT | -o | Write output to a file instead of stdout. |
| Code | Meaning |
|---|---|
0 | Rendered successfully. |
1 | File not found, validation error, or unsupported target. |
mermaid target produces a graph TD flowchart. Unconditional edges are plain arrows; conditional edges are labeled with their when: expression.