> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bonya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a one-off script and collect its output

> Push a script into a disposable sandbox, run it, and see its full result — the CLI's built-in way to do a one-off batch run

Push a script into a disposable sandbox, run it once, and see its full result — no sandbox to create or clean up yourself. `bonya job run` handles all of that: by default it creates a sandbox just for this run and deletes it when the run ends. Every command below uses the deployment's default template; if you haven't installed the CLI or logged in yet, start with the [Quickstart](https://docs.bonya.ai/quickstart.md).

**1. Write the script locally**

```shell theme={null}
cat > report.sh << 'EOF'
#!/bin/sh
echo "Report generated at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "Disk usage:"
df -h /workspace 2>/dev/null || df -h /
echo "Done."
EOF
```

**2. Run it as a job**

`--script` uploads and runs the file in one call; `job run` blocks until it finishes and prints the result. There's no sandbox to create first — one is provisioned for this run and torn down automatically when it's done.

```shell theme={null}
bonya job run --script ./report.sh --name report
```

The script's own stdout appears first, then the run's summary. `SANDBOX` is the disposable sandbox this run created — by the time this printed, it was already deleted.

**3. Look up the run later**

Every run gets an id you can hand to `job get` to see it again, including its full stored spec and timeline — useful if you didn't capture the output the first time:

```shell theme={null}
bonya job get d40295e5e0c9b89a1359721c31a3d6d54b75dea51c44080113b2f40baf9944e3
```

Nothing to clean up — the run's own sandbox already tore itself down. Pass `--keep` to `job run` if you want the sandbox to survive the run instead.

## Next steps

> [card] [Jobs](https://docs.bonya.ai/concepts/jobs.md)
>
> Job schedules, existing-sandbox targeting, and the full spec.

> [card] [Transfer files](https://docs.bonya.ai/guides/transfer-files.md)
>
> The `fs` read/write/upload/download surface, for when you're working against a sandbox you already have.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.