E2B icon

E2B

Run commands and manage E2B sandboxes and snapshots

File → Read

AI-generated

Summary

Read a text file from an E2B sandbox by specifying the sandbox ID and file path.

Inputs

  • Sandbox ID (required) — ID of the sandbox to work with
  • Path (required) — File path inside the sandbox to read
  • Timeout — Timeout in seconds for the operation, default is 300

Output shape

a single record containing the sandbox ID, the file path, and the file content as a text string

If the file reading fails, the operation throws an error. The output JSON includes keys: sandboxId, path, and content.

Links

Discussion