Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/content/docs/sandbox/guides/execute-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,30 @@ await sandbox.exec('python /workspace/analyze.py data.csv');
```
</TypeScriptExample>

## Work with large output

The SDK has no output size limits, allowing you to process large files and datasets without restrictions:

<TypeScriptExample>
```
// Read and process large files
const result = await sandbox.exec('cat large-dataset.csv');
console.log('Dataset size:', result.stdout.length, 'bytes');

// Generate large output
await sandbox.exec('python generate-report.py > /tmp/large-report.json');
const report = await sandbox.readFile('/tmp/large-report.json');

// Process binary data
await sandbox.exec('base64 video.mp4 > /tmp/encoded.txt');
const encoded = await sandbox.readFile('/tmp/encoded.txt');
```
</TypeScriptExample>

:::note
While there are no artificial output size limits, be mindful of Worker memory constraints when processing very large outputs. For extremely large datasets, consider streaming results or writing to files instead of capturing all output in memory.
:::

## Best practices

- **Check exit codes** - Always verify `result.success` and `result.exitCode`
Expand Down
Loading