Skip to content

ProcessClient

Source: src/services/process.ts

ProcessClient(transport: Leap0Transport)

Executes one-shot commands inside a sandbox.

  • Leap0Error: If the process request or response validation fails.
async execute(sandbox: SandboxRef, params: ExecuteProcessParams, options: RequestOptions = {}): Promise<ProcessResult>

Executes a one-shot command inside the sandbox.

  • sandbox: Sandbox ID or sandbox-like object.
  • params: Command execution parameters.
  • params.command: Command line to execute.
  • params.cwd: Optional working directory.
  • params.timeout: Optional command timeout in milliseconds.
  • params.env: Optional environment variables applied to the spawned process.
  • options: Optional request settings such as timeout and query params.
  • The process exit code and collected stdout/stderr output.
const result = await sandbox.process.execute({ command: "node --version" });