Command execution
Run terminal commands as an action input — CLI tools, scripts, curl, df, ps,
package managers, and so on. Parse the output into structured data with parse.
actions:
- name: DiskFree
command:
run: df -h
parse:
data_type: text
split_whitespace: true
Use parse / parse_stderr to turn stdout/stderr into JSON, CSV, or XML — by
delimiter, whitespace, line range, keys, or regex matches.
Success and failure: expect_exit
A command's exit code is its own failure signal, so it decides the action's outcome the same
way an HTTP status does. The default is 0; anything else fails the action, which is what
makes retry, run_when_failed and error branches work against a failing script.
- name: Build
command:
run: ./build.sh # exits non-zero -> the action fails
A failing command returns stdout, stderr and exit_code together, whatever the parse
config says, so an error branch can read the code and whatever the command wrote:
- name: Report
run_when_failed: [Build]
input: a|Build| # .exit_code, .stdout, .stderr
| Value | Meaning |
|---|---|
| unset | 0 is success (the default) |
2 | one exact code |
[0, 1] | any of a list — e.g. grep, where 1 means "no matches" |
any | never fail on the exit code |
CommandRun
| Field | Type | Description |
|---|---|---|
timeout | string (nullable) | How long to let the command run before it is killed, e.g. 30s, 2m. |
name | string (nullable) | Label for this command in traces and logs. Cosmetic — it does not affect the run. |
shell | string (nullable) | Shell to execute run with. Defaults to the platform shell; set it when the command depends on a specific one. |
run | string | Required. The command line to execute. Example ↓ |
parse | CommandParse (nullable) | How to read the command's stdout. Unparsed output stays a plain string, so set this when the command emits structured data you want to use downstream. |
parse_stderr | CommandParse (nullable) | How to read stderr, when the command reports structured errors there. |
expect_exit | ExitExpectation (nullable) | Which exit codes count as a SUCCESSFUL action. Defaults to 0. An exit code is a command's own failure signal, exactly as a status code is an HTTP server's, so it decides the… |
Field examples
run
The command line to execute.
run: curl -s https://example.com/health
CommandParse
| Field | Type | Description |
|---|---|---|
data_type | DataType (nullable) | |
disable_auto_extract | boolean (nullable) | |
delimiter | string (nullable) | |
split_start | string (nullable) | |
split_end | string (nullable) | |
line_start | number (nullable) | |
line_end | number (nullable) | |
keys | Array<string> (nullable) | |
split_by | string (nullable) | |
split_whitespace | boolean (nullable) | |
matches | Array<CommandRegex> (nullable) | |
ignore_output | boolean (nullable) |
CommandRegex
| Field | Type | Description |
|---|---|---|
keys | Array<string> | Required. |
regex | string (nullable) | |
split_by | string (nullable) | |
split_whitespace | boolean (nullable) |