run_streaming_command() method is designed for executing long-running or interactive commands inside your sandbox while receiving real-time output streams.
Unlike run_command(), this method does not block until completion — it allows you to process live logs or incremental output as the command runs.
run_streaming_command() -> dict
Description:Executes a long-running command inside the sandbox and streams output in real time. Callbacks are triggered as new stdout or stderr data chunks arrive.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
cmd | str | Yes | Command to execute (e.g., "npm", "python3") |
args | List[str] | Yes | List of command arguments |
stdin | str | No | Optional standard input to send to the command |
on_stdout | Callable[[str], None] | No | Callback function invoked when stdout data arrives |
on_stderr | Callable[[str], None] | No | Callback function invoked when stderr data arrives |
Returns:
