tenki_exec
Run a command in an existing sandbox session and retrieve stdout, stderr, and exit code inline. Large output is returned as a head and tail preview, with full output saved to files in the sandbox.
Instructions
Run a command in an existing sandbox and return stdout, stderr, and exit code inline. Streams over max_output_bytes (default 64KB) come back as a head+tail preview with the full output retained at stdoutPath/stderrPath in the sandbox.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (honored in-script). | |
| env | No | Environment variables as a key→value object. | |
| args | No | Arguments. | |
| command | Yes | Executable, e.g. 'npm' or 'python3'. | |
| session_id | Yes | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. | |
| timeout_seconds | No | ||
| max_output_bytes | No | Per-stream inline output cap in bytes (default 65536). Larger output is truncated head+tail and kept in the sandbox at stdoutPath/stderrPath. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True only when exitCode is 0 AND stdout/stderr capture succeeded. | |
| args | Yes | Arguments the executable was invoked with. | |
| stderr | Yes | Captured standard error (empty when capture failed — see captureError). | |
| stdout | Yes | Captured standard output (empty when capture failed — see captureError). | |
| command | Yes | The executable that was run. | |
| exitCode | Yes | Process exit code; 0 means success. (The API omits zero values; the server normalizes an absent code to 0.) | |
| stderrPath | No | Sandbox path holding the FULL stderr, present only when truncated — page through it with tenki_exec (e.g. sed -n / tail -c). | |
| stdoutPath | No | Sandbox path holding the FULL stdout, present only when truncated — page through it with tenki_exec (e.g. sed -n / tail -c). | |
| captureError | No | Present when the command ran but its output could not be read back; stdout/stderr are unknown, not empty. | |
| stderrTruncated | No | Present (true) when stderr exceeded the output cap and carries only a head+tail preview. | |
| stdoutTruncated | No | Present (true) when stdout exceeded the output cap and carries only a head+tail preview. |