Options for running a command in a sandbox.
interface RunOptionsHalf-close the command's stdin so a command that reads it sees EOF
rather than blocking until the timeout. Defaults to true for a non-PTY
command, which means sendInput() on the returned handle throws unless
this is set to false. Ignored under pty: true, where input and output
share one terminal file descriptor -- send an EOT byte (0x04) as input
instead.
Client-assigned command ID. Executing with an existing command ID re-attaches to that command (get-or-create) instead of starting a new one. Only used by the WebSocket path.
Idle timeout in seconds. If the command has no connected clients for this duration, it is killed. Defaults to 300 (5 minutes). Set to -1 for no idle timeout.
If true, kill the command immediately when the last client disconnects. Defaults to false (command continues running and can be reconnected to).
Callback invoked with each stderr chunk during streaming execution. When provided, WebSocket streaming is used.
Callback invoked with each stdout chunk during streaming execution. When provided, WebSocket streaming is used.
If true, allocate a pseudo-terminal (PTY) for the command. Useful for commands that require a TTY (e.g., interactive programs, commands that use terminal control codes). Defaults to false.
User, working directory and environment for this one command, layered over the sandbox's own.
Shell to use for command execution. Defaults to "/bin/bash".
Command timeout in seconds.
How long (in seconds) a finished command's session is kept for reconnection. Defaults to 600 (10 minutes). Set to -1 to keep indefinitely.
Whether to wait for the command to complete before returning. When true (default), returns an ExecutionResult. When false, returns a CommandHandle for streaming output.
Working directory for command execution.
Environment variables to set for the command.