Cookbook & Power-User Tricks
Short, copy-pasteable recipes for the things you’ll reach for daily. Each one links to the page where the concept is taught in full — this page is the cheat sheet, not the tutorial.
Starter mise.toml
Section titled “Starter mise.toml”The 30-second per-project baseline: tools, env, and one task. Drop it in, mise install, go.
[tools]node = "22"python = "3.13"
[env]_.file = ".env" # load dotenv if presentDATABASE_URL = { default = "postgres://localhost/dev_db" }
[tasks.dev]run = "npm run dev"description = "Start the dev server"Why: this single file replaces an .nvmrc, an .envrc, and a make dev. Commit it, gitignore mise.local.toml. See Tools and Environments.
Ad-hoc tool, zero config
Section titled “Ad-hoc tool, zero config”Run any tool at any version without touching mise.toml — mise installs it on the fly and throws it away after.
mise x node@22 -- node --versionmise exec python@3.12 go@1.23 -- ./build.sh # multiple tools at onceWhy: perfect for one-off scripts and quick checks. mise x is the alias for mise exec. See Install & Activate.
mise exec in cron, systemd & scripts
Section titled “mise exec in cron, systemd & scripts”Non-interactive contexts never run your shell rc, so mise activate was never wired up. Use mise exec (or shims) to make tools resolve anyway.
# crontab: full path to mise, exec the tool from the project dir*/5 * * * * cd /srv/app && /home/deploy/.local/bin/mise exec -- node cron-job.js[Service]WorkingDirectory=/srv/appExecStart=/home/deploy/.local/bin/mise exec -- node server.jsWhy: mise exec reads the project’s mise.toml and sets up PATH/env for that one command — no activation, no login shell. The alternative is putting ~/.local/share/mise/shims on PATH. See CI, Docker & IDEs.
Python auto-venv
Section titled “Python auto-venv”Let mise create and activate the project virtualenv whenever you enter the directory.
[tools]python = "3.13"
[env]_.python.venv = { path = ".venv", create = true }Why: cd in and the venv is active; no python -m venv + source dance, and it works in CI and editors too. See Environments & Secrets.
corepack enable for pnpm / yarn
Section titled “corepack enable for pnpm / yarn”Pin Node and get the right package-manager shims provisioned automatically via a per-tool postinstall.
[tools]node = { version = "22", postinstall = "corepack enable" }Why: mise install now leaves pnpm/yarn ready (driven by your packageManager field) — no global npm i -g pnpm. The postinstall hook gets MISE_TOOL_VERSION. See Watch, Hooks & Automation.
Auto-install on enter
Section titled “Auto-install on enter”Make entering a project guarantee its tools are present, so teammates never hit “command not found”.
[hooks]enter = "mise install"Why: combined with a committed mise.lock, the first cd into a freshly cloned repo installs the exact pinned toolchain. Needs an active mise activate session. See Watch, Hooks & Automation.
Multi-platform lockfile
Section titled “Multi-platform lockfile”Generate one mise.lock that resolves on every machine your team and CI use — Linux x64 and Apple Silicon, say.
mise lock --platform linux-x64,macos-arm64[settings]lockfile = trueWhy: the lockfile records exact versions, checksums, and per-platform download URLs, so mise install --locked is reproducible everywhere. Commit mise.lock; there is no --frozen flag. See Tools & Backends.
Secrets with sops + age
Section titled “Secrets with sops + age”End-to-end encrypted env that lives safely in the repo. The age private key stays on the machine, never committed.
mise use -g sops ageage-keygen -o ~/.config/mise/age.txt # note the public key it printssops encrypt -i --age <age-public-key> .env.json[settings]experimental = true # secrets are experimental
[env]_.file = { path = ".env.json", redact = true } # auto-decrypts on loadWhy: secrets are encrypted at rest and redacted in mise env output; mise finds the key via MISE_SOPS_AGE_KEY → ~/.config/mise/age.txt. For teams, look at jdx’s fnox. See Environments & Secrets.
Monorepo task fan-out
Section titled “Monorepo task fan-out”Run one task across every project in the workspace with a single command.
monorepo_root = true
[monorepo]config_roots = ["packages/*", "services/*"]mise run "//...:test" # run `test` in every config_root, at any depthmise run "//services/api:deploy" # one specific projectWhy: //...:task fans out across the monorepo; :task targets the current root. Declare config_roots — auto filesystem-walk discovery is deprecated. See Designing Your Workflow.
MISE_ENV dev / ci / prod profiles
Section titled “MISE_ENV dev / ci / prod profiles”Layer environment-specific config on top of the base mise.toml.
[env]LOG_LEVEL = "warn"DATABASE_URL = { default = "postgres://prod-host/app" }MISE_ENV=production mise run migrateWhy: MISE_ENV=production loads mise.production.toml over mise.toml (and mise.production.local.toml over that). Comma-list allowed, last wins. See Environments & Secrets.
confirm on a destructive task
Section titled “confirm on a destructive task”Add a y/n gate before a task that drops data or deploys.
[tasks.db-reset]run = "dropdb app_dev && createdb app_dev && mise run migrate"confirm = "This wipes the dev database. Continue?"Why: one key turns a footgun into a prompt; skip it in automation with MISE_YES=1 mise run db-reset. See The Task Runner.
Task args with the usage spec
Section titled “Task args with the usage spec”Give a task real flags and arguments — typed, documented, and tab-completable.
[tasks.greet]usage = '''arg "<name>" help="Who to greet"flag "-l --loud" help="Shout it"'''run = '''msg="hello, $usage_name"[ "$usage_loud" = "true" ] && msg=$(echo "$msg" | tr a-z A-Z)echo "$msg"'''mise run greet world --loud # HELLO, WORLDWhy: parsed args surface as $usage_<name> env vars and feed shell completions. Don’t reach for the old Tera arg()/flag() functions — they’re removed in 2027.5.0. See The Task Runner.
Generate a git pre-commit hook
Section titled “Generate a git pre-commit hook”Wire a mise task into git’s pre-commit hook in one command.
mise generate git-pre-commit --write --task pre-commit[tasks.pre-commit]run = "mise run lint ::: mise run test" # staged files available in $STAGEDWhy: the generated hook just runs mise run pre-commit, so the logic lives in your committed config, not an unversioned .git/hooks script. For richer hooks see the sister tool hk. See Watch, Hooks & Automation.
Shell aliases from config
Section titled “Shell aliases from config”Define shell aliases in mise.toml so they travel with the project (or your global config).
[shell_alias]mr = "mise run"mx = "mise exec --"Why: project-scoped aliases that activate with the directory — no editing .zshrc for every repo. Needs an active mise activate session. See Install & Activate.
Debugging: doctor, which, where
Section titled “Debugging: doctor, which, where”When a tool resolves to the wrong thing, these three answer “what does mise think is going on?”.
mise doctor # config, activation, untrusted paths, version warningsmise which node # the real binary path mise resolves (not the shim)mise where node@22 # the install directory for a specific versionWhy: which node may show a shim; mise which node shows the actual resolved binary. mise doctor is the first stop for activation and trust problems — and confirms you’re on mise ≥ 2026.6.4. See Install & Activate.