How to Set Custom Mise Installs Directory
How I made mise install Zig into a repo-local directory so VS Code could find the binary.
I was working on a private project called cpm. One component, cpm-cli, is
written in Zig. I pinned zig and zls with mise, but the Zig VS Code
extension did not find the binary when mise installed it into the global mise
location. The fix was tiny and worth keeping in my notes.
Put this in your mise.toml (I keep mine in cli/mise.toml):
[env]
# install mise-managed tools into a directory inside this repo
MISE_INSTALLS_DIR = "{{config_root}}/.mise/installs"
[tools]
zig = "0.15.2"
zls = "0.15.0"Why this works for me
MISE_INSTALLS_DIRtells mise where to put the downloaded tool binaries.{{config_root}}resolves to the directory that contains the config file, so the path is project-relative and predictable.- With the example above, if the config is
cli/mise.toml, mise will put binaries incli/.mise/installs/..., which my editor can see.
What I did
-
Added the snippet to
cli/mise.toml. -
From the
clifolder ran:Shellcd cli mise install -
Checked the installed binary:
Shellls -l .mise/installs/*/bin/zig
The Zig binary appeared under the repo-local .mise directory, and the VS Code
extension stopped complaining.
A tiny nicety: ignore the installs directory in git
Create or edit cli/.gitignore and add:
# Ignore locally-installed mise tools
.mise/Notes from my run
- If your
mise.tomlis at repo root,{{config_root}}/.mise/installswill be at repo root. If your tooling lives in aclifolder, put the mise config incliand installs will be undercli/.mise/installs. - For CI, run the same
mise installstep in the same relative path before building.