Every box has its own isolated filesystem. Upload, write, read, list, and download files inside the box.
API#
Upload files#
Push local files into the box. Each entry maps a local file to a destination inside the box. Relative destinations resolve against the box’s current directory, /workspace/home by default.
All files in a call are sent in a single request. Each file can be up to 100 MB, and a request up to about 1 GB in total. Each path must be a file, not a directory.
Write files#
Create or overwrite a file directly from a string. Useful when you want to inject configuration, scripts, or generated content without a local file.
Read files#
Read the contents of a file as a string.
Read part of a file#
Pass length to read a bounded byte range instead of the whole file, starting at offset (default 0). This keeps a large log or dataset out of memory when you only need a slice of it. The server rejects a length above 8 MiB.
Inspect a path#
Get metadata for a single path without reading it: the entry type, size, last modified time, inode, and an opaque version token.
Use version for optimistic concurrency. Read it before a slow operation, then compare it afterwards to detect whether the file changed underneath you. Compare it for equality only, and do not parse it.
By default a symlink is reported as "symlink". Pass follow to resolve it and describe the target instead.
Create directories#
Create a directory. Pass parents to create missing parent directories, the way mkdir -p does, and to succeed when the directory already exists.
Move and rename#
Move a path to a new location, which is also how you rename it.
Delete files#
Remove a file. Removing a directory requires recursive, so a directory is never deleted by accident.
List files#
List the entries in a directory. Each entry includes the name, path, size, whether it is a directory, and the last modified timestamp.
Download files#
Pull files from a box directory back to your local machine. Pass a folder to download that directory into ./<folder name>, or call with no arguments to download the current directory (./workspace for the default /workspace/home).
Downloads are not recursive: only the files directly inside the directory are downloaded, and subdirectories are skipped. folder must be a directory, not a single file. To fetch one file, use files.read.
Examples#
Feed data to an agent#
Upload input files, run the agent, then read back the structured result.
Inject config before a run#
Write environment-specific configuration into the box, then let the agent use it.
Collect outputs from parallel boxes#
Fan out work across multiple boxes. Each box writes to its own output folder, so the downloads land in separate local folders.