run_command
Runs a shell command in WSL and waits for completion, returning stdout, stderr, and exit code. Supports multi-line scripts, cwd, env vars, timeout, and guardrail blocking.
Instructions
Run a shell command in WSL (foreground, waits for completion). Supports multi-line scripts, cwd, env vars, and timeout. Returns stdout (and stderr, separately when separateStderr=true; otherwise stderr is merged into stdout) and exit code. Dangerous commands are blocked by the guardrail (confirm=true overrides confirmable ones).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (absolute POSIX or ~) | |
| env | No | Environment variables for this command only | |
| distro | No | ||
| command | Yes | The shell command(s) to run; may be multi-line | |
| confirm | No | Confirm a command flagged by the guardrail | |
| timeoutMs | No | Timeout in ms; default commandTimeoutMs | |
| binaryOutput | No | Return stdout/stderr as base64 instead of UTF-8 text | |
| separateStderr | No | Capture stderr separately (stderr field) instead of merging into stdout |