execute
Run shell commands in isolated SSH or local sessions, with support for long-running tasks and interactive input management via command IDs.
Instructions
Execute a command in a session (SSH or local). Each call runs in an
isolated channel — there is NO persistent shell between calls. For simple
tasks chain with && ("cd /foo && ls"); for persistent state (cd, venv, env
vars) start a Zellij session and drive it via CLI instead.
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, vim) MUST be started in foreground. Do NOT
background them with `&` — it breaks their init. The "partial" return after
a short timeout is expected: the server has already daemonized 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. Each call is stateless; for persistent state (cd, venv, env vars), drive a Zellij session instead of chaining && | |
| 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) |