Getting started with Mise
What is mise and how to use it
Mise is a tool for managing tasks, environment variables, and developer tools across projects.
Install and activate mise
To install Mise, run the following command:
curl https://mise.run | shNext, add Mise to your shell configuration. For zsh:
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrcUsing mise
Install a Global Tool
To install Node.js version 22 globally:
mise use --global node@22Check Tool Version
You can verify the installed version using:
mise exec -- node -v# Output: v22.x.xIf Mise is activated, you can also run the command directly:
node -v# Output: v22.x.xConfiguration Files
Mise uses a configuration file to manage tools globally.
The global configuration file is located at ~/.config/mise/config.toml.
This is an example configuration:
[tools]node = "22"Mise also keeps local configuration files in the project directory (mise.toml).
Devtools
To use a specific tool version in a project directory, navigate to the project and run:
cd my-projectmise use node@22This command ensures the correct version of Node.js (v22) is used within the project.
Environment Variables
You can define project-specific environment variables with Mise. For example:
mise set NODE_ENV=developmentThis sets the NODE_ENV variable to development for the current project.
Tasks
Mise allows you to define tasks in a mise.toml file.
Here’s an example mise.toml file:
[tasks.build]description = "Build the CLI"run = "cargo build"To run the build task, execute:
mise run buildThat’s it!
Bonus
Enable just completions by adding this to your mise global file:
[hooks.enter]shell = "bash"script = "eval '$(just --completions zsh)'"