execute
Run shell commands in SSH or local terminal sessions. Handles long-running processes and interactive commands with partial output support.
Instructions
Execute a command in a session (SSH or local). Always use this to run
shell commands — there is no persistent shell between calls, so chain
state-changing commands with && (e.g. "cd /foo && ls").
Returns a dict:
status="completed": exit_code, output filled in. Command is done.
status="partial": command_id filled in. Command is still running.
Continue with one of:
read_output(cid) — no input needed (logs/build)
respond(cid, text) — command awaits input
send_control(cid, key) — send Ctrl+C / arrows / F-keys
(do nothing, let it run — fine for daemons)
Long-running TUI apps (zellij, tmux, vim) MUST be started in foreground.
Do NOT background them with `&` — that breaks their initialization. The
"partial" return after a short timeout is expected and correct; the
server has already daemonized itself and is safe to abandon.
Args:
- pause_timeout: seconds of OUTPUT SILENCE before returning (default 9.0).
Dominates return time for silent commands — raise this (not
total_timeout) when polling a quiet long-running job.
- total_timeout: hard cap on this call's duration (default 20.0). Only
binds while output is actively streaming.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The unique session identifier returned by connect_ssh or create_local | |
| command | Yes | The shell command to execute (e.g., 'ls -la' or 'npm run build'). Can chain multiple commands with && or ; | |
| pause_timeout | No | Seconds of output silence to wait before returning a partial response (default is 9.0) | |
| total_timeout | No | Hard cap in seconds on the maximum duration of this call (default is 20.0) |