| name | mise-tasks |
| description | Guide to using mise task runner features efficiently. Use when you need to automate workflows, manage build dependencies, or optimize execution with caching. |
Mise Tasks
Core Concepts
Mise Tasks provides a powerful, language-agnostic task runner that replaces Makefiles, npm scripts, or shell scripts.
- DAG Execution: Tasks form a Directed Acyclic Graph, ensuring dependencies run in the correct order.
- Parallelism: Independent tasks run in parallel by default (defaults to 4 jobs).
- Caching: Skips execution if
sources (input files) haven't changed relative to outputs.
- Environment: Tasks run within the
mise environment, with access to all tools defined in mise.toml.
Defining Tasks
Tasks are defined in mise.toml under the [tasks] table or as standalone scripts in .mise/tasks/.
Basic Configuration (mise.toml)
[tasks.build]
description = "Build the application"
run = "npm run build"
dir = "frontend"
env = { NODE_ENV = "production" }
File-Based Tasks
Create an executable script at .mise/tasks/deploy:
#!/bin/bash
echo "Deploying..."
Dependencies & Execution Order
Mise manages execution order using three types of dependencies:
depends: Hard dependencies. Must run successfully before this task.
depends_post: Cleanup/follow-up tasks. Run after this task (even on failure, if configured).
wait_for: Soft dependencies. Only waits if the task is already in the execution graph (doesn't trigger it).
[tasks.test]
depends = ["build"]
[tasks.deploy]
depends = ["test"]
[tasks.clean]
description = "Cleanup artifacts"
Caching (Incremental Builds)
Drastically speed up workflows by defining inputs and outputs. Mise calculates fingerprints to skip redundant work.
[tasks.compile_go]
run = "go build -o bin/app ./cmd/app"
sources = ["**/*.go", "go.mod", "go.sum"]
outputs = ["bin/app"]
If bin/app exists and is newer than all sources, mise run compile_go will skip execution.
Advanced Configuration
Using Tools in Tasks
Tasks automatically use tools defined in [tools]. You don't need mise x --.
[tools]
node = "20"
[tasks.start]
run = "node server.js"
Aliases & Hiding
[tasks.llm_generate]
alias = "gen"
hide = true
Running Tasks
- Run a task:
mise run build
- Run multiple:
mise run build test deploy
- Pass arguments:
mise run build -- --flag (passed to the underlying command)
- Watch mode:
mise watch build (re-runs when sources change)
- Dry run:
mise run build --dry-run (print order without executing)
- Force run:
mise run build --force (ignore cache)
Architecture & Best Practices
- Granularity: Break large scripts into smaller tasks. This maximizes parallelism and caching hits.
- Explicit Dependencies: Don't rely on implicit ordering. If
B needs A, verify it via depends.
- Directory Context: Use
dir to run tasks in subprojects (monorepo style) instead of cd ... && ....
- Clean Environments: Tasks inherit the shell environment but prioritize
mise tools.
References