Skip to content

shell

Run a local shell command. Captures stdout / stderr / exit_code.

Sourceinternal/agents/workflow/nodes/shell.go
When to useOperating on local files, running a CLI tool, escape hatch for anything wick hasn't typed yet.
GateParticipates in Command Gate policy when enabled — PermissionMode applies.

Schema

FieldTypeRequiredNotes
commandtemplateThe command line. Rendered as Go template.
cwdpath (template)Working directory. Default: workflow folder.
envmap (template)Extra environment variables. Each value is rendered.
parse_outputdropdownraw (default) / json / lines.
timeout_secintPer-call timeout in seconds.

Output

FieldTypeWhat
stdoutstringCaptured stdout.
stderrstringCaptured stderr.
exit_codeintProcess exit code.

When parse_output: json and stdout is valid JSON, the parsed value is also merged into .Node.<id>.* (so {"foo": "bar"} exposes .Node.<id>.foo). parse_output: lines splits stdout on \n and stores the array under .Node.<id>.lines.

Example

json
{
  "id": "count_files",
  "type": "shell",
  "command": "find {{.Env.PROJECT_DIR}} -name \"*.go\" | wc -l",
  "parse_output": "raw"
}

Pair with

  • go_script — pure Go alternative when you don't need to spawn a process.
  • transform — reshape the captured output before passing downstream.
  • http — for HTTP-only side-effects, prefer this over curl.
Built with ❤️ by a developer, for developers.