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 documented in Volumes.

Quick Start

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

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

text = sandbox.files.read_text("/tmp/hello.txt")
print(text)
hx file write <sandbox-id> /tmp/hello.txt --data 'hello from sandbox'
hx file cat <sandbox-id> /tmp/hello.txt