Prepare experimental
The mise prepare command ensures project dependencies are ready by checking if lockfiles are newer than installed outputs (e.g., package-lock.json vs node_modules/) and running install commands if needed.
Quick Start
# Enable experimental features
export MISE_EXPERIMENTAL=1
# Run all applicable prepare steps
mise prepare
# Or use the alias
mise prepConfiguration
Configure prepare providers in mise.toml:
# Built-in npm provider (auto-detects lockfile)
[prepare.npm]
auto = true # Auto-run before mise x/run
# Built-in providers for other package managers
[prepare.yarn]
[prepare.pnpm]
[prepare.bun]
[prepare.go]
[prepare.pip]
[prepare.poetry]
[prepare.uv]
[prepare.bundler]
[prepare.composer]
# Custom provider
[prepare.codegen]
auto = true
sources = ["schema/*.graphql"]
outputs = ["src/generated/"]
run = "npm run codegen"
# Disable specific providers
[prepare]
disable = ["npm"]Built-in Providers
mise includes built-in providers for common package managers:
| Provider | Lockfile | Output | Command |
|---|---|---|---|
npm | package-lock.json | node_modules/ | npm install |
yarn | yarn.lock | node_modules/ | yarn install |
pnpm | pnpm-lock.yaml | node_modules/ | pnpm install |
bun | bun.lockb or bun.lock | node_modules/ | bun install |
go | go.mod | vendor/ or go.sum | go mod vendor or go mod download |
pip | requirements.txt | .venv/ | pip install -r requirements.txt |
poetry | poetry.lock | .venv/ | poetry install |
uv | uv.lock | .venv/ | uv sync |
bundler | Gemfile.lock | vendor/bundle/ | bundle install |
composer | composer.lock | vendor/ | composer install |
Built-in providers are only active when explicitly configured in mise.toml and their lockfile exists.
Custom Providers
Create custom providers for project-specific build steps:
[prepare.codegen]
sources = ["schema/*.graphql", "codegen.yml"]
outputs = ["src/generated/"]
run = "npm run codegen"
description = "Generate GraphQL types"
[prepare.prisma]
sources = ["prisma/schema.prisma"]
outputs = ["node_modules/.prisma/"]
run = "npx prisma generate"Provider Options
| Option | Type | Description |
|---|---|---|
auto | bool | Auto-run before mise x and mise run (default: false) |
sources | string[] | Files/patterns to check for changes |
outputs | string[] | Files/directories that should be newer than sources |
run | string | Command to run when stale |
env | table | Environment variables to set |
dir | string | Working directory for the command |
description | string | Description shown in output |
Freshness Checking
mise uses modification time (mtime) comparison to determine if outputs are stale:
- Find the most recent mtime among all source files
- Find the most recent mtime among all output files
- If any source is newer than all outputs, the provider is stale
This means:
- If you modify
package-lock.json,node_modules/will be considered stale - If
node_modules/doesn't exist, the provider is always stale - If sources don't exist, the provider is considered fresh (nothing to do)
Auto-Prepare
When auto = true is set on a provider, it will automatically run before:
mise run(task execution)mise x(exec command)
This ensures dependencies are always up-to-date before running tasks or commands.
To skip auto-prepare for a single invocation:
mise run --no-prepare build
mise x --no-prepare -- npm testStaleness Warnings
When using mise activate, mise will warn you if any auto-enabled providers have stale dependencies:
mise WARN prepare: npm may need update, run `mise prep`This can be disabled with:
[settings]
status.show_prepare_stale = falseCLI Usage
# Run all applicable prepare steps
mise prepare
# Show what would run without executing
mise prepare --dry-run
# Force run even if outputs are fresh
mise prepare --force
# List available prepare providers
mise prepare --list
# Run only specific providers
mise prepare --only npm --only codegen
# Skip specific providers
mise prepare --skip npmParallel Execution
Prepare providers run in parallel, respecting the jobs setting for concurrency limits. This speeds up preparation when multiple providers need to run (e.g., both npm and pip).
[settings]
jobs = 4 # Run up to 4 providers in parallelExample: Full-Stack Project
# mise.toml for a project with Node.js frontend and Python backend
[prepare.npm]
auto = true
[prepare.poetry]
auto = true
[prepare.prisma]
auto = true
sources = ["prisma/schema.prisma"]
outputs = ["node_modules/.prisma/"]
run = "npx prisma generate"
[prepare.frontend-codegen]
sources = ["schema.graphql", "codegen.ts"]
outputs = ["src/generated/"]
run = "npm run codegen"Running mise prep will check all four providers and run any that are stale, in parallel.