AsyncProcessClient
Source: leap0/_async/process.py
Signature
Section titled “Signature”AsyncProcessClient(transport: AsyncTransport)Overview
Section titled “Overview”Execute one-shot shell commands inside a running sandbox.
Use this client for non-interactive command execution where you want the full result back as a single response.
Attributes: None.
Methods
Section titled “Methods”execute
Section titled “execute”async execute(sandbox: SandboxRef, *, command: str, cwd: str | None = None, env: dict[str, str] | None = None, timeout: int | None = None) -> ProcessResultRun a shell command and wait for the result.
The command runs inside /bin/sh -c.
Args: sandbox: Sandbox ID or object. command: Shell command to execute. cwd: Working directory. env: Optional environment variables applied to the spawned process. timeout: Timeout in seconds (default 30).
Returns: ProcessResult: Command result including exit code, stdout, and stderr.
Example:
result = await sandbox.process.execute( command="ls -la /workspace",)print(result.stdout)print(result.stderr)