bhatti ps
List active sessions inside a sandbox.
Synopsis
Section titled “Synopsis”bhatti ps <sandbox>
Description
Section titled “Description”A session is a process the guest agent is tracking — typically because it has a PTY, was started detached, or was launched as the sandbox’s --init script. Active sessions persist across client disconnections and show up here regardless of whether anyone is attached.
The init script (from bhatti create --init "...") appears as a session named init. You can attach to it with bhatti shell (passing its session ID via the API) to watch progress.
Sessions without an attached client and without recent I/O are eventually garbage-collected by an idle timer. Active sessions (producing output or accepting input) are never killed by the timer.
Examples
Section titled “Examples”bhatti ps devID COMMAND RUNNING ATTACHEDinit npm install && npm run dev true falses1 /bin/zsh -li true trues2 ./long-running-worker.sh true falsebhatti ps dev --json | jq '.[] | select(.attached == false) | .session_id'Options
Section titled “Options”This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.
See also
Section titled “See also”bhatti shell— open or reattach to an interactive sessionbhatti exec --detach— start a session in the background- API:
GET /sandboxes/:id/sessions