mise run
- Usage:
mise run [FLAGS] [TASK] [ARGS]… - Aliases:
r - Source code:
src/cli/run.rs
Run tasks and their dependencies
Run one task with mise run TASK [ARGS...], or several with ::: between them. Put mise flags before the task name; everything after it goes to the task. With no task, mise runs the default task if there is one, or opens a task picker in an interactive terminal.
Tasks come from [tasks] in mise.toml and from task directories such as mise-tasks/. A task with sources and outputs is skipped while its outputs are up to date; --force runs it anyway. For example:
[tasks.build]
run = "npm run build"
sources = ["src/**/*.ts", "package.json", "package-lock.json"]
outputs = ["dist/**/*.js"]The experimental artifact cache (a task's cache field) has separate --task-cache controls.
To create a script task, run mise tasks add --file hello -- echo hello, then mise run hello. See https://mise.jdx.dev/tasks/running-tasks.html
Flags
--affected— Run matching tasks only in projects affected by Git changesCounts committed changes between the base and head revisions, plus staged, unstaged, and untracked changes in the working tree when the head revision is the checked-out commit. Requires a monorepo root (
monorepo_root = true).--affected-base <REV>— Git base revision for--affectedDefaults to
MISE_AFFECTED_BASE, CI metadata, orHEAD~1.--affected-committed— Count committed changes between the base and head revisionsAlone, ignores the working tree. Combines with
--affected-uncommittedand--affected-untracked. With none of the three, every source counts (the working-tree sources only when the head revision is the checked-out commit). Also set byMISE_AFFECTED_COMMITTED.--affected-explain— Explain why--affectedselected each project and task--affected-head <REV>— Git head revision for--affectedDefaults to
MISE_AFFECTED_HEAD, CI metadata, orHEAD.--affected-json— Print the affected projects and tasks as JSON without running tasks--affected-uncommitted— Count staged and unstaged changes to tracked filesCombines with the other source flags. Alone, ignores committed changes. Needs the head revision to be the current checkout. Also set by
MISE_AFFECTED_UNCOMMITTED.--affected-untracked— Count untracked files that Git does not ignoreCombines with the other source flags. Alone, ignores committed changes. Needs the head revision to be the current checkout. Also set by
MISE_AFFECTED_UNTRACKED.--all— Open the task picker with tasks from every project in the monorepo-c --continue-on-error— Continue running tasks even if one fails-C --cd <DIR>— Change to this directory before running the tasks-f --force— Run the tasks even if their outputs are up to date-j --jobs <JOBS>— Number of tasks to run in parallel (default: thejobssetting)Values below 1 are treated as 1.
Environment Variable:
MISE_JOBS-n --dry-run— Print the tasks in the order they would run, without running them-o --output <OUTPUT>— How task output is displayedprefix- Print stdout/stderr by line, prefixed with the task's labelinterleave- Print directly to stdout/stderr instead of by linereplacing- Stdout is replaced each time, stderr is printed as istimed- Only show stdout lines if they are displayed for more than 1 secondkeep-order- Print stdout/stderr by line, prefixed with the task's label, but keep the order of the outputquiet- Deprecated; use--output interleave --quietsilent- Do not show any output, including the task's stdout and stderr, except errors
Environment Variable:
MISE_TASK_OUTPUT-q --quiet— Do not show extra outputEnvironment Variable:
MISE_QUIET-r --raw— Connect the tasks directly to stdin, stdout, and stderr instead of reading their output by lineRedactions are not applied, and tasks run one at a time. Set the
rawsetting to make this the default.--secrets <SECRET>— [experimental] Give the named tasks these secrets (comma-separated); their dependencies and subtasks do not get themPut this flag before the task name. Not allowed in safe mode.
--secrets-all— [experimental] Give the named tasks every secret the project can inject; their dependencies and subtasks do not get themCovers the fnox secrets with
env = trueorenv = "exec", never those withenv = false. Put this flag before the task name. Not allowed in safe mode.-s --shell <SHELL>— Shell used to run TOML tasks that do not set their ownshellDefaults to
sh -o errexit -con Unix andcmd /con Windows, from theunix_default_inline_shell_argsorwindows_default_inline_shell_argssetting. A task'sshellproperty takes precedence over this flag.-S --silent— Do not show any output except for errorsEnvironment Variable:
MISE_SILENT-t --tool <TOOL@VERSION>— Extra tools to use with the tasks, e.g. node@24 [email protected]--allow-env <VAR>— Allow a specific env var through (implies--deny-envfor everything else)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 task without network restrictions. See https://mise.jdx.dev/sandboxing.html#access-to-particular-hosts
--allow-read <PATH>— Allow reads from a specific path (implies--deny-readfor everything else)--allow-write <PATH>— Allow writes to a specific path (implies--deny-writefor everything else)--deny-all— Block reads, writes, network, and env vars--deny-env— Block env var inheritance except PATH, HOME, USER, SHELL, TERM, COLORTERM, and LANGOn Windows it also keeps the variables programs need to start, such as
SystemRootandTEMP.--deny-net— Block all network access--deny-read— Block filesystem reads (system libraries and tool directories stay readable)--deny-write— Block filesystem writes except temporary and device paths (/tmp, /dev)--fresh-env— Bypass the environment cache and recompute the environment--no-cache— Do not use the cache for remote tasksEnvironment Variable:
MISE_TASK_REMOTE_NO_CACHE--no-deps— Do not run[deps]providers that haveauto = truebefore the tasks--no-timings— Hide the elapsed time printed after each task completesSet
task.timings = falseto hide it by default.--skip-deps— Run only the named tasks, not the tasks they depend onEnvironment Variable:
MISE_TASK_SKIP_DEPENDS--skip-tools— Do not install missing tools before running the tasksSet
task.run_auto_install = falseto make this the default.--task-cache <TASK_CACHE>— [experimental] Set artifact cache access for this runread-write- Read cached results and write new resultsread-only- Read cached results without writing new resultswrite-only- Write new results without reading cached resultsoff- Disable the artifact cachelocal-only- Read and write only the local cache, skipping any remote cache
Choices:
read-write,read-only,write-only,off,local-onlyDefault:
read-writeEnvironment Variable:
MISE_TASK_CACHE--task-cache-explain— [experimental] Explain the inputs that produced each task's artifact cache key--task-cache-explain-json— [experimental] Print cache-key input details as JSON Lines without running tasks (requires--dry-run)--task-cache-stats— [experimental] Report artifact cache hits, restored bytes, and time saved--timeout <TIMEOUT>— Stop the run if it takes longer than this, e.g. 30s or 5mOverrides the
task.timeoutsetting.
Examples
Run the "lint" task, defined in mise.toml or as a script
mise run lintRun "build" even if its outputs are up to date
mise run --force buildRun "test" connected directly to the terminal, one task at a time
mise run --raw testRun the "lint", "test", and "check" tasks in parallel
mise run lint ::: test ::: checkRun several tasks, each with its own arguments
mise run cmd1 arg1 arg2 ::: cmd2 arg1 arg2Run tasks one at a time
mise run -j 1 lint ::: testRun every task that matches a pattern
mise run 'test:*'Run a task in a monorepo project
mise run //services/api:buildGive "deploy" the DEPLOY_KEY secret (experimental); its dependencies do not get it
mise run --secrets DEPLOY_KEY deploy