The following demo shows:
mise exec
mise
jq
terraform
go
node
mise exec <tool> -- <command> allows you to run any tools with mise
mise exec <tool> -- <command>
mise exec node@22 -- node -v # mise node@22.14.0 ✓ installed # v22.14.0
node is only available in the mise environment, not globally
node -v # bash: node: command not found
Here is another example where we run terraform with mise exec
mise exec terraform -- terraform -v # mise terraform@1.11.3 ✓ installed # Terraform v1.11.3
mise exec is great for running one-off commands, however it can be convenient to activate mise. When activated, mise will automatically update your PATH to include the tools you have installed, making them available directly.
PATH
We will start by installing node@lts and make it the global default
mise use --global node@lts # v22.14.0
node -v # v22.14.0
which node # /root/.local/share/mise/installs/node/22.14.0/bin/node
Note that we get back the path to the real node here, not a shim.
We can also install other tools with mise. For example, we will install terraform, jq, and go
mise use -g terraform jq go # mise jq@1.7.1 ✓ installed # mise terraform@1.11.3 ✓ installed # mise go@1.24.1 ✓ installed # mise ~/.config/mise/config.toml tools: go@1.24.1, jq@1.7.1, terraform@1.11.3
terraform -v # Terraform v1.11.3
jq --version # jq-1.7
go version # go version go1.24.1 linux/amd64
mise ls # Tool Version Source Requested # go 1.24.1 ~/.config/mise/config.toml latest # jq 1.7.1 ~/.config/mise/config.toml latest # node 22.14.0 ~/.config/mise/config.toml lts # terraform 1.11.3 ~/.config/mise/config.toml latest
Let's enter a project directory where we will set up node@23
cd myproj mise use node@23 pnpm@10 # mise node@23.10.0 ✓ installed # mise pnpm@10.7.0 ✓ installed
node -v # v23.10.0 pnpm -v # 10.7.0
As expected, node -v is now v23.x
node -v
cat mise.toml # [tools] # node = "23" # pnpm = "10"
We will leave this directory. The node version will revert to the global LTS version
cd .. node -v # v22.14.0