Skip to main content
This section covers the sandbox local filesystem: the files and directories inside a running sandbox. Use it to:
  • Inspect paths and metadata.
  • Read and write text or bytes.
  • Move, copy, and remove files.
  • Watch for file system changes.
  • Upload, download, and generate presigned transfer URLs.
This section is about the sandbox’s local filesystem. Persistent volumes are a separate surface and are not covered here.

Quick Start

await sandbox.files.writeText("/tmp/hello.txt", "hello from sandbox");

const text = await sandbox.files.readText("/tmp/hello.txt");
console.log(text);

Available Capabilities

The local filesystem API includes these core operations:
  • Path existence, stat, and directory listing.
  • Partial reads with offset and length.
  • Text writes, byte writes, and batch writes.
  • Directory creation plus move, copy, chmod, chown, and remove.
  • File watches for change streams.
  • Raw upload and download.
  • Presigned upload and download URLs, including one-time URLs.

In This Section