docs/tasks/index.md
Define and run project tasks for building, testing, linting, deploying, and everyday development workflows.
You can define tasks in mise.toml files or as standalone shell scripts. These are useful for
things like running linters, tests, builders, servers, and other tasks that are specific to a
project. Of
course, tasks launched with mise will include the mise environment—your tools and env vars defined
in mise.toml.
Here's my favorite features about mise's task runner:
There are 2 ways to define tasks: inside of mise.toml files or as standalone shell scripts. You can also use task templates to create reusable task definitions.
mise.toml filesTasks are defined in the [tasks] section of the mise.toml file.
[tasks.build]
description = "Build the CLI"
run = "cargo build"
You can then run the task with mise run build (or mise build if it doesn't conflict with an existing command).
You can also define tasks as standalone shell scripts. All you have to do is to create an executable file in a specific directory like mise-tasks.
#!/usr/bin/env bash
#MISE description="Build the CLI"
cargo build
You can then run the task with mise run build like for TOML tasks.
See the file tasks reference for more information.
The following environment variables are passed to the task:
MISE_ORIGINAL_CWD: The original working directory from where the task was run.MISE_CONFIG_ROOT: The directory containing the mise.toml file where the task was defined or if the config path is something like ~/src/myproj/.config/mise.toml, it will be ~/src/myproj.MISE_PROJECT_ROOT: The root of the project.MISE_TASK_NAME: The name of the task being run.MISE_TASK_DIR: The directory containing the task script.MISE_TASK_FILE: The full path to the task script.