terminal_run
Execute long-running shell commands and stream their output incrementally with configurable timeout and line limits. Returns final output, exit code, and timeout status.
Instructions
Run a long-running terminal command and stream its output.
Designed for commands that produce output over time: test runners, build pipelines, or any program that writes incrementally to stdout.
Each output line is forwarded as a tool_execution_update event on
the per-task event stream when a task context is available, allowing
clients to render partial output in real time.
Parameters
command:
Shell command string (passed to /bin/sh -c or cmd.exe /c).
cwd:
Working directory. Defaults to the server process cwd.
timeout:
Wall-clock timeout in seconds (default 600 — 10 minutes).
Pass null for no limit.
max_output_lines:
Maximum lines retained in the final output field. Lines
beyond this limit are still forwarded to the event stream but
are not included in the final return value.
Returns
{"output": str, "exit_code": int, "timed_out": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| cwd | No | ||
| timeout | No | ||
| max_output_lines | No |