Execution & shells
Commands that drive execution inside a running sandbox: one-shot commands, interactive shells, and visibility into what’s currently running and listening.
| Command | Description |
|---|---|
bhatti exec | Run a command. Streaming or buffered output, optional timeout, optional detach. |
bhatti shell | Open an interactive shell with detach/reattach semantics (alias: sh). |
bhatti ps | List active sessions in a sandbox (init scripts, shells, detached execs). |
bhatti ports | List listening ports detected inside a sandbox. |
All commands wake cold sandboxes transparently — you don’t need to start the sandbox first.
Quick patterns
Section titled “Quick patterns”bhatti exec dev -- npm install # one-shot commandbhatti exec dev -- bash -c 'echo $API_KEY' # shell expansion via /bin/bashbhatti exec dev --timeout 60 -- long-running.sh # cap runtime at 60sbhatti exec dev --detach -- ./worker.sh # run in background, return PID
bhatti shell dev # interactive (Ctrl+\ to detach)bhatti shell dev --new # don't reattach to a running session
bhatti ps dev # what's running inside?bhatti ports dev # what's listening?See also
Section titled “See also”- Sandbox commands — create/list/destroy
- Files — read and write files inside sandboxes
- API:
POST /sandboxes/:id/exec— the underlying HTTP endpoint, streaming and detach modes