mise exec โ
- Usage:
mise exec [FLAGS] [TOOL@VERSION]โฆ [-- COMMAND]โฆ - Aliases:
x - Source code:
src/cli/exec.rs
Run a command with mise's tools and environment
Loads the tools and [env] from your config into one child process without changing the current shell. Use it in scripts and CI, or to run a tool that is not in the config.
TOOL@VERSION arguments add tools or override the configured version of that tool only: with node = "24" in mise.toml, mise exec python@3.13 -- python -V still has node 24 on PATH.
Put the command after --, or pass a shell command string with -c. Missing tools are installed first unless the exec_auto_install or auto_install setting is off; when you name tools, only those are installed. The --allow-and --deny- flags sandbox the command; see https://mise.jdx.dev/sandboxing.html.
By default, PATH entries that come before mise's shims directory stay ahead of mise's tool directories in the command's environment. mise exec -- node looks the program up with mise's tools first, but a child that searches PATH itself, such as /usr/bin/env node or a -c command, finds those entries first. Set activate_aggressive to put mise's tool directories first for that run.
Arguments โ
[TOOL@VERSION]โฆโ Tools to add or override, such asnode@24 python@3.13[-- COMMAND]โฆโ Executable and arguments to run directly, after--
Flags โ
-c --command <COMMAND>โ Command string to run through a shell (supports pipes and redirection)-j --jobs <JOBS>โ How many tools to install in parallel; defaults to thejobssettingValues below 1 are treated as 1.
Environment Variable:
MISE_JOBS--allow-env <VAR>โ Pass only VAR through from the environment (implies --deny-env)Supports wildcards, such as --allow-env='MYAPP_*'.
--allow-net <HOST>โ Allow network access only to HOST (not supported on any platform)Per-host filtering does not work: Linux and macOS exit with an error, and Windows runs the command without network restrictions. See https://mise.jdx.dev/sandboxing.html#access-to-particular-hosts
--allow-connect-port <PORT>โ Allow outbound TCP connections to PORT on any IP address (Linux 6.7 or later)Blocks TCP connections to other ports and creation of other IP sockets. Repeat to allow multiple ports. Conflicts with --deny-net and --deny-all.
--allow-read <PATH>โ Allow reads from PATH (implies --deny-read for everything else)--allow-write <PATH>โ Allow writes to PATH (implies --deny-write for everything else)--allow-unix <PATH>โ Allow connections to the Unix socket at PATH, or to every socket under it if PATH is a directory (implies --deny-unix for every other socket)Abstract sockets created inside the sandbox stay reachable. Linux 7.1 or later only.
--deny-allโ Block reads, writes, network, and env vars--deny-envโ Block env var inheritance except PATH, HOME, USER, SHELL, TERM, COLORTERM, LANGOn Windows it also keeps the variables programs need to start, such as SystemRoot and TEMP.
--deny-netโ Block all network access--deny-readโ Block filesystem reads (system libs and tool dirs still accessible)--deny-writeโ Block filesystem writes except temporary and device paths (/tmp, /dev)--deny-unixโ Block connections to Unix sockets outside the sandbox (Linux 7.1 or later)--fresh-envโ Bypass the environment cache and recompute the environment--no-depsโ Skip automatic dependency preparation--rawโ Connect install commands directly to the terminal; implies --jobs=1--secrets <SECRET>โ [experimental] Give the command these secrets (comma-separated); by default it gets none--secrets-allโ [experimental] Give the command every secret the project can inject, except file secrets-h --helpโ Print help
Examples โ
Run app.js with node 24
mise exec node@24 -- node ./app.jsRun a shell command string
mise x node@24 python@3.13 -c "node -v && python -V"Run in another project's directory
mise x -C ~/work/api -- npm testRun without network access
mise x --deny-net -- npm run build[experimental] Pass one secret from the project's secrets source
mise x --secrets GH_TOKEN -- gh release list