Files
Upload and download files through a running sandbox. Paths must be absolute,
normalized file paths, such as /work/input.txt, without .. components or a
trailing slash. Each upload or download is limited to 16 MiB.
Upload a file
Send a local file as raw bytes. The parent directory must already exist; create it first with a command:
adapt files put "$SANDBOX_ID" ./input.txt /work/input.txt
A successful upload returns 204 after the guest verifies the data and atomically
replaces the file with mode 0644. Symlinks and special files are rejected.
An interrupted upload before commit leaves the old file intact. A lost response
after commit can leave a completed write; retrying replaces the whole file.
Download a file
The CLI encodes file paths for you. With curl, use --data-urlencode for paths
that may contain spaces or punctuation:
adapt files get "$SANDBOX_ID" /work/input.txt ./downloaded-input.txt
To read the response in your terminal, use - as the CLI's local destination
or omit curl's --output. The CLI refuses to overwrite an existing local file;
add --force to replace it.
Work with directories
Use commands to create or list directories, move files, or remove files:
adapt exec "$SANDBOX_ID" --detach \
-- /bin/sh -lc 'mkdir -p /work/results && ls -la /work'