sbx.files is the Filesystem instance available on every Sandbox. All paths must be absolute paths within the sandbox filesystem.
sbx.files.read()
Read a file’s content as a string.
Absolute path inside the sandbox.
Unix user context for the read operation.
Per-request HTTP timeout in milliseconds.
Promise<string>
sbx.files.write()
Write content to a file, creating parent directories automatically.
Absolute destination path.
Content to write. Accepts a string or a
Uint8Array (decoded as UTF-8).Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<WriteInfo>
sbx.files.writeFiles()
Write multiple files in a single batch request.
Array of
WriteEntry objects. Each has path (string) and data (string
or Uint8Array).Unix user context applied to all files.
Per-request HTTP timeout in milliseconds.
Promise<WriteInfo[]>
sbx.files.list()
List entries in a directory.
Absolute path to the directory.
Recursion depth.
1 lists only immediate children.Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<EntryInfo[]>
sbx.files.exists()
Check whether a path exists.
Absolute path to check.
Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<boolean>
sbx.files.getInfo()
Get metadata about a file or directory.
Absolute path to query.
Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<EntryInfo>
sbx.files.remove()
Remove a file or directory.
Absolute path to remove.
Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<void>
sbx.files.rename()
Rename or move a file or directory.
Current absolute path.
New absolute path. Can be in a different directory (move semantics).
Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<EntryInfo> for the renamed entry.
sbx.files.makeDir()
Create a directory (including parent directories if needed).
Absolute path of the directory to create.
Unix user context.
Per-request HTTP timeout in milliseconds.
Promise<boolean> — true if the directory was created.
sbx.files.watchDir()
Watch a directory for filesystem change events.
Absolute path of the directory to watch.
Unix user context.
Whether to watch subdirectories recursively.
Per-request HTTP timeout in milliseconds.
Promise<WatchHandle>
Data models
EntryInfo
FileType
WriteInfo
WriteEntry
FilesystemEvent
FilesystemEventType
WatchHandle
getNewEvents() to pull
buffered events. There is no async iterator or callback subscription.