Share feedback
Answers are generated based on the documentation.

sbx exec

DescriptionExecute a command inside a sandbox
Usagesbx exec [flags] SANDBOX COMMAND [ARG...]

Description

Execute a command in a sandbox. If the sandbox is stopped, it is started first.

Flags match the behavior of "docker exec".

Options

OptionDefaultDescription
-d, --detachDetached mode: run command in the background
--detach-keysOverride the key sequence for detaching a container
-e, --envSet environment variables
--env-fileRead in a file of environment variables
-i, --interactiveKeep STDIN open even if not attached
--privilegedGive extended privileges to the command
-t, --ttyAllocate a pseudo-TTY
-u, --userUsername or UID (format: <name|uid>[:<group|gid>])
-w, --workdirWorking directory inside the container

Global options

OptionDefaultDescription
-D, --debugEnable debug logging

Examples

# Open a shell inside a sandbox
sbx exec -it my-sandbox bash

# Run a command in the background
sbx exec -d my-sandbox npm start

# Run as root
sbx exec -u root my-sandbox apt-get update