[go: up one dir, main page]

Share feedback
Answers are generated based on the documentation.
{ const container = $el; // The div with overflow const item = document.getElementById('sidebar-current-page') if (item) { const containerTop = container.scrollTop; const containerBottom = containerTop + container.clientHeight; const itemTop = item.offsetTop - container.offsetTop; const itemBottom = itemTop + item.offsetHeight; // Scroll only if the item is out of view if (itemBottom > containerBottom - 200) { container.scrollTop = itemTop - (container.clientHeight / 2 - item.offsetHeight / 2); } } })" class="bg-background-toc dark:bg-background-toc fixed top-0 z-40 hidden h-screen w-full flex-none overflow-x-hidden overflow-y-auto md:sticky md:top-16 md:z-auto md:block md:h-[calc(100vh-64px)] md:w-[320px]" :class="{ 'hidden': ! $store.showSidebar }">

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