Skip to main content
The TypeScript SDK exposes stdio through sandbox.stdio. Use stdio.start() to launch a process with an open stdin pipe, then send data, receive output, and close stdin or kill the process. For conceptual background see the Stdio feature overview.

sandbox.stdio.start(cmd, opts?)Promise<StdioProcess>

Start a subprocess with an open stdin pipe.

StdioStartOpts

StdioProcess

Handle for an interactive subprocess with stdin pipe.

Properties

  • proc.cmdId: string — server-assigned command identifier.
  • proc.exitCode: number | nullnull while the process is running.

Methods

proc.sendStdin(data, requestTimeout?): Promise<void>

Send data to the process’s stdin. Accepts string or Uint8Array.

proc.closeStdin(requestTimeout?): Promise<void>

Close the process’s stdin pipe, sending EOF.

proc.kill(requestTimeout?): Promise<boolean>

Terminate the process. Returns true if the process existed at the time of the call.

proc.wait(): Promise<StdioResult>

Resolves when the process exits. If callbacks were provided at start time, this awaits the background stream. Otherwise it opens a new stream and drains it (discarding output).

proc.stream(opts?): Promise<StdioResult>

Opens the SSE output stream and delivers chunks via callbacks. Resolves when the process exits.
Use stream() when you didn’t provide callbacks at start time.

StdioResult