Create a new client. All options are optional - defaults work against a local server.
Download a file from the Boxer file store.
To retrieve output files written by a container to /output/, use the
path pattern "output/<exec_id>/<filename>". The execution must have been
started with persist: true.
Relative path of the file to download (e.g. "output/boxer-abc123/result.json").
Raw file contents as a Uint8Array.
Returns true if the server responds with a 2xx status, false for non-OK responses.
Network-level failures (connection refused, DNS error, timeout) propagate as exceptions
so callers can distinguish between "server is up but unhealthy" and "server is unreachable".
Pull image (if not cached) and run cmd inside a gVisor sandbox.
OCI image reference, e.g. "python:3.12-slim".
Command and arguments to execute, e.g. ["python3", "-c", "print(1)"].
Optional execution parameters (limits, files, network, …).
A RunResult with exit code, stdout, stderr, and timing.
BoxerTimeoutError if the wall-clock limit or client timeout is exceeded.
BoxerOutputLimitError if stdout/stderr exceeds the server limit.
BoxerAPIError for other server-side errors.
Upload a file to the Boxer file store so it can be bind-mounted in a
subsequent run call via options.files.
The file is stored at remotePath on the server and mounted read-only
at /<remotePath> inside the container.
Destination path on the server (e.g. "script.py" or "data/input.csv").
File content as a Blob, Uint8Array, or ArrayBuffer.
HTTP client for the Boxer sandbox execution API.
Uses the web-standard
fetchAPI with zero dependencies. Compatible with Node.js 18+, Bun, Deno, and browsers.Example