exec#
- SandboxRuntime.exec(instance_id: str, command: str | List[str], timeout: float | None = None, cwd: str | None = None, env: Dict[str, str] | None = None, shell: str | None = None) ExecResult[source]#
Execute a command inside the specified sandbox.
- Parameters:
instance_id – Unique identifier of the sandbox instance.
command – Command to execute, either as a string or a list of arguments.
timeout – Maximum execution time in seconds.
cwd – Working directory inside the sandbox for command execution.
env – Environment variables to set for the command.
shell – Optional shell for string commands, overriding the sandbox’s configured shell (default /bin/bash).
- Returns:
ExecResult containing exit code, stdout, and stderr.