Command on host
runExecutes a command on a remote host and waits for the result. Handles timeouts, sudo passwords from ~/.ssh/.secret, and masks sensitive output.
Instructions
Run a command on a host and wait for the result.
On timeout the local ssh is killed (exit_code null, timed_out true) — use start for long-running commands. The sudo password is taken from ~/.ssh/.secret and masked in the output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory; defaults to home. `~` and `~/…` are expanded, everything else is taken literally. | ~ |
| host | Yes | Alias from ~/.ssh/config. | |
| sudo | No | auto — decide from the command; true — prime the password unconditionally; false — don't prime it (needed where sudo is configured NOPASSWD). | auto |
| stdin | No | Text for the command's stdin. | |
| command | Yes | Command for the host's shell. | |
| timeout | No | Seconds; null — the default from settings. Above the server's cap — a call error. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stderr | Yes | ||
| stdout | Yes | ||
| duration | Yes | duration, seconds | |
| exit_code | Yes | return code; null — killed by timeout | |
| sudo_used | Yes | whether the sudo password was primed | |
| timed_out | Yes | ||
| stderr_truncated | Yes | ||
| stdout_truncated | Yes |