Skip to content

Connect to a sandbox with CLI

Run agentbox sandbox connect SANDBOX_ID to open an interactive terminal in a running sandbox. Closing the terminal disconnects the CLI but does not kill the sandbox.

sh
agentbox sandbox connect "$sandbox_id"

Use --user to select the Linux user, --cwd to set the initial working directory, and repeat --env KEY=VALUE for environment variables. Put these options before the sandbox ID.

For a non-interactive task, use agentbox sandbox exec instead.