execute
Run privileged commands or multi-stage pipelines locally or on a remote sudo-proxy host after a human approves the request at that host's terminal.
Instructions
Execute a command (or multi-stage pipeline) on a sudo-proxy host after a human approves it at that host's terminal. Provide argv for a single command or pipeline for piped stages (e.g. [["ls", "/tmp"], ["wc", "-l"]]); host targets a remote daemon started via start_server (omit for localhost). Unprivileged commands on the local machine are refused — use your Bash tool, which applies the same controls. timeout is in milliseconds (max 600000); it defaults to 120000 for privileged commands but is opt-in for unprivileged ones (omitted = wait as long as the daemon needs, so an approved-but-slow command is not falsely timed out). Blocks until the human answers, then returns the final stage's stdout plus per-stage stderr and exit codes. Errors: 'Request denied by user.' if the human declines, a timeout error if unanswered within 60s, and 'sudo-proxy is not running' if the daemon is down — call start_server first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment variables | |
| argv | No | Command as argument array | |
| host | No | Target host (omit for localhost) | |
| timeout | No | Timeout in milliseconds, max 600000. For privileged commands the default is 120000. For unprivileged commands the timeout is opt-in: if omitted, the call waits as long as the daemon needs (the 60s approval prompt and the executor's own bound still apply), so an approved-but-slow command is not falsely reported as timed out. Set it explicitly to bound either. | |
| pipeline | No | Pipeline of commands, each as an argument array. Use this for piped commands like [["ls", "/tmp"], ["wc", "-l"]]. | |
| privileged | No | Privilege escalation (default: true) | |
| description | No | What this command does (shown in TUI prompt) | |
| forward_agent | No | Forward the local SSH agent to the command (unprivileged only). Requires the proxy session to have been started with `forward_agent: true`. Useful for `git clone` of private repos via SSH on a remote host. |