mise tasks run
- Usage:
mise tasks run [FLAGS] - Aliases:
r - Source code:
src/cli/run.rs
Run task(s)
This command will run a task, or multiple tasks in parallel. Tasks may have dependencies on other tasks or on source files. If source is configured on a task, it will only run if the source files have changed.
Tasks can be defined in mise.toml or as standalone scripts. In mise.toml, tasks take this form:
[tasks.build]
run = "npm run build"
sources = ["src/**/*.ts"]
outputs = ["dist/**/*.js"]Alternatively, tasks can be defined as standalone scripts. These must be located in mise-tasks, .mise-tasks, .mise/tasks, mise/tasks or .config/mise/tasks. The name of the script will be the name of the tasks.
$ cat .mise/tasks/build<<EOF
#!/usr/bin/env bash
npm run build
EOF
$ mise run buildFlags
--affected— Run matching tasks only for projects affected by Git changes--affected-base <REV>— Git base revision for --affected Defaults to MISE_AFFECTED_BASE, CI metadata, or HEAD~1--affected-explain— Explain why projects and tasks were selected by --affected--affected-head <REV>— Git head revision for --affected Defaults to MISE_AFFECTED_HEAD, CI metadata, or HEAD--affected-json— Output affected projects and tasks as JSON without running tasks--all— Open the interactive selector with all tasks from the entire monorepo-c --continue-on-error— Continue running tasks even if one fails-C --cd <CD>— Change to this directory before executing the command-f --force— Force the tasks to run even if outputs are up to date-j --jobs <JOBS>— Number of tasks to run in parallel Values below 1 are treated as 1 [default: 4] Configure withjobsconfig orMISE_JOBSenv varEnvironment Variable:
MISE_JOBS-n --dry-run— Don't actually run the task(s), just print them in order of execution-o --output <OUTPUT>— Change how tasks information is output when running tasksprefix- 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- Don't show extra outputsilent- Don't show any output including stdout and stderr from the task except for errors
Environment Variable:
MISE_TASK_OUTPUT-q --quiet— Don't show extra outputEnvironment Variable:
MISE_QUIET-r --raw— Read/write directly to stdin/stdout/stderr instead of by line Redactions are not applied with this option Configure withrawconfig orMISE_RAWenv var-s --shell <SHELL>— Shell to use to run toml tasksDefaults to
sh -c -o errexit -o pipefailon unix, andcmd /con Windows Can also be set with the settingMISE_UNIX_DEFAULT_INLINE_SHELL_ARGSorMISE_WINDOWS_DEFAULT_INLINE_SHELL_ARGSOr it can be overridden with theshellproperty on a task.-S --silent— Don't show any output except for errorsEnvironment Variable:
MISE_SILENT-t --tool <TOOL@VERSION>— Tool(s) to run in addition to what is in mise.toml files e.g.: node@20 python@3.10--allow-env <VAR>— Allow specific env var through (implies --deny-env for everything else) Supports wildcards, e.g. --allow-env='MYAPP_*'--allow-net <HOST>— Allow network to specific host (implies --deny-net for everything else)--allow-read <PATH>— Allow reads from specific path (implies --deny-read for everything else)--allow-write <PATH>— Allow writes to specific path (implies --deny-write for everything else)--deny-all— Block reads, writes, network, and env vars--deny-env— Block env var inheritance (only PATH, HOME, USER, SHELL, TERM, LANG pass through)--deny-net— Block all network access--deny-read— Block filesystem reads (system libs and tool dirs still accessible)--deny-write— Block all filesystem writes--fresh-env— Bypass the environment cache and recompute the environment--no-cache— Do not use cache on remote tasksEnvironment Variable:
MISE_TASK_REMOTE_NO_CACHE--no-deps— Skip automatic dependency preparation--no-timings— Hides elapsed time after each task completesDefault to always hide with
MISE_TASK_TIMINGS=0--skip-deps— Run only the specified tasks skipping all dependenciesEnvironment Variable:
MISE_TASK_SKIP_DEPENDS--skip-tools— Skip installing tools before running tasksCan also be set persistently with the
task.run_auto_installsetting orMISE_TASK_RUN_AUTO_INSTALL=falseenv var--task-cache <TASK_CACHE>— Set task output 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 task output cachinglocal-only- Read and write only the local cache; currently equivalent toread-write
Choices:
read-write,read-only,write-only,off,local-onlyDefault:
read-writeEnvironment Variable:
MISE_TASK_CACHE--task-cache-explain— Explain the inputs that produced each task's output cache key--task-cache-explain-json— Output cache-key input details as JSON Lines without running tasks--task-cache-stats— Report task output cache hits, restored bytes, and time saved--timeout <TIMEOUT>— Timeout for the task to complete e.g.: 30s, 5m
Examples:
# Runs the "lint" tasks. This needs to either be defined in mise.toml
# or as a standalone script. See the project README for more information.
$ mise run lint
# Forces the "build" tasks to run even if its sources are up-to-date.
$ mise run --force build
# Run "test" with stdin/stdout/stderr all connected to the current terminal.
# This forces `--jobs=1` to prevent interleaving of output.
$ mise run --raw test
# Runs the "lint", "test", and "check" tasks in parallel.
$ mise run lint ::: test ::: check
# Execute multiple tasks each with their own arguments.
$ mise run cmd1 arg1 arg2 ::: cmd2 arg1 arg2