Skip to content

bhatti ps

List active sessions inside a sandbox.

bhatti ps <sandbox>

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.

Terminal window
bhatti ps dev
ID COMMAND RUNNING ATTACHED
init npm install && npm run dev true false
s1 /bin/zsh -li true true
s2 ./long-running-worker.sh true false
Terminal window
bhatti ps dev --json | jq '.[] | select(.attached == false) | .session_id'

This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.