Skip to content

bhatti file read

Read a file from a sandbox and write its bytes to stdout.

bhatti file read <sandbox> <path>

Streams the file’s contents to stdout, byte-for-byte. The path must be absolute. Cold sandboxes wake transparently before the read.

The CLI always reads the whole file. The API supports partial reads (offset, limit, max_bytes query params) for tailing logs without transferring the entire file — call it directly when you need that. Every response includes an X-File-Size header so clients can detect truncation. See API: files.

Terminal window
bhatti file read dev /workspace/app.js
Terminal window
# Pipe to other tools
bhatti file read dev /workspace/data.json | jq .name
Terminal window
# Save to a local file
bhatti file read dev /var/log/agent.log > agent-$(date +%F).log

This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.