Skip to main content

devbox run

Starts a new interactive shell and runs your target script in it. The shell will exit once your target script is completed or when it is terminated via CTRL-C. Scripts can be defined in your devbox.json.

You can also run arbitrary commands in your devbox shell by passing them as arguments to devbox run. For example:

  devbox run echo "Hello World"

Will print Hello World to the console from within your devbox shell.

For more details, read our scripts guide

  devbox run <script | command> [flags]

Examples

# Run a command directly:
devbox add cowsay
devbox run cowsay hello
# Run a command that takes flags:
devbox run cowsay -d hello
# Pass flags to devbox while running a command.
# All `devbox run` flags must be passed before the command
devbox run -q cowsay -d hello

#Run a script (defined as `"moo": "cowsay moo"`) in your devbox.json:
devbox run moo

Options

OptionDescription
-c, --config stringpath to directory containing a devbox.json config file
-e, --env stringToStringenvironment variables to set in the devbox environment (default [])
--env-file stringpath to a file containing environment variables to set in the devbox environment
-h, --helphelp for run
-q, --quietQuiet mode: Suppresses logs.

SEE ALSO

  • devbox - Instant, easy, predictable shells and containers