File operations
Move bytes in and out of a sandbox without opening a shell. Useful for scripted setup, fetching results, and inspecting state.
| Command | Description |
|---|---|
bhatti file read | Read a file from a sandbox to stdout. |
bhatti file write | Write a file from stdin into a sandbox. Atomic. |
bhatti file ls | List directory contents inside a sandbox. |
The CLI exposes the simplest forms — read whole files, write whole files. The underlying API supports partial reads (offset, limit, max_bytes), permission control (mode), and HEAD-style stat requests; reach for it directly when you need those. See the API reference for the full surface.
Quick patterns
Section titled “Quick patterns”bhatti file read dev /workspace/app.jsecho 'config' | bhatti file write dev /etc/configbhatti file ls dev /workspace/bhatti file read dev /workspace/data.json | jq .Limits
Section titled “Limits”- Writes are capped at 100 MB per request.
- Directory listings are capped at 10 000 entries; a sentinel entry indicates truncation.
- Writes are atomic — temp file, fsync, rename. Concurrent readers never see a partial file.