Documentation

Config Reference

A complete guide to every Seristack YAML attribute: stack definitions, variables, validation rules, execution modes, timeouts, HTTP endpoints, MCP tools, and output handling.

Root object

Seristack configs are YAML files with a root stacks list.

stacks:
  - name: example
    cmds:
      - echo "hello from seristack"
AttributeTypeRequiredDescription
stackslistyesList of stack/workflow definitions.

Stack attributes

AttributeTypeRequiredDefaultDescription
namestringyesnoneUnique stack name. Used by CLI selection, HTTP routes, MCP tools, dependencies, and registry output keys.
descriptionstringnoemptyHuman-readable description. Required for exposing a stack as an MCP tool.
methodstringnoemptyHTTP method such as GET, POST, PUT, PATCH, or DELETE. Required for HTTP endpoint exposure.
urlPathstringno/<name>Custom HTTP route path.
workDirstringnosource/config directory behaviorWorking directory for command execution.
continueOnErrorbooleannofalseContinue command execution after failures and record errors.
dependsOnlistno[]Stacks that must run before this stack.
varslistnoemptyVariable definitions and validation rules.
executionModestringnoPARALLELConcurrency strategy for count iterations and commands.
countintegerno0Number of times to run commands. 0 skips execution.
timeoutsstringno1hPer-command timeout using Go duration syntax.
shellstringnomvdan shellExternal shell executable such as bash, sh, or powershell.
shellArgstringno-cArgument passed to the external shell before the script.
cmdslistnoemptyCommands/scripts executed by the stack.
outputstringnoemptyOptional post-processing command using {{.Self.result}}.
discardOutputlistnoemptyRegistry output keys to remove after the current stack completes.

Variables and validation

Variables can be used in commands with {{.Vars.variable_name}}.

vars:
  - name: env
    value: dev
    required: true
    allowed_value: [dev, stage, prod]
AttributeTypeRequiredDescription
namestringyesVariable name. Must be unique within the stack.
valuestringnoDefault variable value.
requiredbooleannoFinal value must not be empty.
allowed_valuelistnoAllows only listed values.
denied_valuelistnoRejects listed values.
allowed_regexstringnoAllows only values matching regex(...).
denied_regexstringnoRejects values matching regex(...).
Only one of allowed_value, denied_value, allowed_regex, or denied_regex can be used per variable. required can be combined with one of them.

Runtime values can come from CLI flags, HTTP query/form/JSON body, HTTP X-* headers, and MCP tool arguments.

Execution modes

ModeCount iterationsCommands inside each iteration
PARALLELconcurrentconcurrent
STAGEconcurrentsequential
PIPELINEsequentialconcurrent
SEQUENTIALsequentialsequential

Use SEQUENTIAL when ordering matters. Use PARALLEL when maximum concurrency is desired.

Timeouts

timeouts controls the maximum duration for each command execution. Default: 1h.

500ms

500 milliseconds

30s

30 seconds

5m

5 minutes

1h

1 hour

1h30m

1 hour 30 minutes

2.5h

2 hours 30 minutes

Supported units: ns, us/µs, ms, s, m, h. Use 24h instead of 1d.

Shell settings

If shell is omitted, Seristack uses the built-in mvdan shell interpreter. External shells can be configured with shell and shellArg.

shell: bash
shellArg: -c

Commands, output, and registry cleanup

cmds

cmds:
  - |
    echo "starting"
    echo "finished"

output

Post-process accumulated stack output through {{.Self.result}}.

output: |
  echo '{{.Self.result}}' | grep "^{" | jq -s '{records: ., total: length}'

discardOutput

discardOutput: [build, test]

HTTP endpoint behavior

A stack becomes an HTTP endpoint when method is set.

name: greet-api
method: GET
urlPath: /greet

HTTP variables can come from query parameters, form values, JSON request body, and headers beginning with X-.

MCP tool behavior

A stack becomes an MCP tool when description is set. Variables declared in vars become MCP tool arguments.

Complete example

stacks:
  - name: greet-api
    description: Greets a user from CLI, HTTP, or MCP
    method: GET
    urlPath: /greet
    workDir: ./
    count: 1
    timeouts: 30s
    executionMode: SEQUENTIAL
    vars:
      - name: name
        value: engineer
        required: true
        allowed_regex: regex("^[a-zA-Z0-9_-]+$")
      - name: env
        value: dev
        allowed_value: [dev, stage, prod]
    cmds:
      - |
        echo "Hello {{.Vars.name}} from {{.Vars.env}}"

  - name: collect-metadata
    description: Produces JSON metadata for aggregation
    dependsOn: [greet-api]
    count: 2
    timeouts: 5m
    executionMode: SEQUENTIAL
    vars:
      - name: env
        value: dev
    cmds:
      - |
        echo "{\"index\": {{.Count.index}}, \"env\": \"{{.Vars.env}}\", \"status\": \"ok\"}"
    output: |
      echo '{{.Self.result}}' | grep "^{" | jq -s '{records: ., total: length}'

  - name: cleanup-output
    dependsOn: [collect-metadata]
    discardOutput: [greet-api]
    count: 1
    timeouts: 10s
    cmds:
      - echo "discarded greet-api output from memory"