Execute command
exec_commandExecute bounded shell commands with explicit working directories, a call wait time, and a total process timeout. Commands still running return a command_id so you can poll output later.
Instructions
Run a bounded command under runtime policy. Pass workdir explicitly for reconnect-safe paths. yield_time_ms is only how long this call waits (default 10s); timeout_ms is the total process lifetime (default 300s). A command still running when the call returns keeps running under its command_id; poll it with write_stdin or read_output. Example: {"cmd":"pytest -q","workdir":".","yield_time_ms":30000}. Retained output is bounded per stream; for very large output redirect to a file (cmd > out.log 2>&1) and page it with read_file or search_text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cmd | Yes | ||
| cwd | No | ||
| env | No | ||
| tty | No | ||
| stdin | No | ||
| workdir | No | . | |
| verbosity | No | preview | |
| timeout_ms | No | Total process lifetime in milliseconds. The command is killed when this elapses, whether or not the call has already returned. | |
| preview_bytes | No | ||
| yield_time_ms | No | How long this call waits before returning. A command still running at that point keeps running and returns a command_id; it is not killed. | |
| max_output_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| signal | No | ||
| status | No | ||
| stderr | No | ||
| stdout | No | ||
| preview | No | ||
| summary | No | ||
| warnings | No | ||
| exit_code | No | ||
| timed_out | No | ||
| truncated | No | ||
| command_id | No | ||
| elapsed_ms | No | ||
| output_ref | No | ||
| next_action | No | ||
| output_refs | No | ||
| next_actions | No | ||
| output_stream | No | ||
| output_truncated | No | ||
| stderr_truncated | No | ||
| stdout_truncated | No | ||
| operation_outcome | No | ||
| preview_truncated | No | ||
| stderr_output_bytes | No | ||
| stderr_output_lines | No | ||
| stderr_truncated_by | No | ||
| stdout_output_bytes | No | ||
| stdout_output_lines | No | ||
| stdout_truncated_by | No | ||
| stderr_dropped_bytes | No | ||
| stderr_omitted_bytes | No | ||
| stdout_dropped_bytes | No | ||
| stdout_omitted_bytes | No | ||
| truncated_output_streams | No |