Skip to content

Interfaces

CommandStartOpts

Options for commands.run.

optional background?: boolean

Start detached and resolve with a CommandHandle at once.


optional cwd?: string

Working directory (default /work; relative paths resolve against /work).


optional envs?: Record<string, string>

Added to the sandbox-level envs.


optional onStderr?: (data) => void

string

void


optional onStdout?: (data) => void

Output callbacks, called as data arrives. A character whose bytes arrive in two pieces is delivered whole, with the later piece. Foreground only (for background commands, pass them to handle.wait()).

string

void


optional stdin?: string | Uint8Array<ArrayBufferLike>

Sent to the command, then closed (at most 16 MiB). Foreground only.


optional timeoutMs?: number

Kill the command after this long (ms, default 60000; 0 = no limit). Foreground only.