Claus-Theodor Riegg
8 years
Claus-Theodor Riegg
7 years
Stefan Langenmaier
1 year
Andreas Vöst
5 months
Claus-Theodor Riegg
5 years
Andreas Vöst
6 months
Emma Heinle
7 months
Andreas Vöst
7 months

HowTo: switch to mise from asdf

Posted . Visible to the public.

Add apt source:

apt update -y && apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
sudo apt update
sudo apt install -y mise

Configure Shell

You don't have to add it to PATH, the following command does that for you

Bash:

echo 'eval "$(mise activate bash)"' >> ~/.bashrc

ZSH:

echo 'eval "$(mise activate zsh)"' >> ~/.zshrc

Remove asdf

Of course you'll have to remove any mention of asdf from your shell config. After you're confident you don't need the asdf setup any more, you can delete $HOME/.asdf as well.

Shell addons

If you rely on things installed via mise for your shell setup, e.g. starship
to have a nicer prompt, you'll find that it won't work out of the box. The reason
is that mise only updates your $PATH when the prompt is being displayed Show archive.org snapshot ).

For these commands you can call mise explicitly in your shell config:

eval "$(mise exec starship -- starship init zsh)"

Where the first starship is the name of the mise/asdf plugin and the second one is the name of the plugin we're calling.

Install tools

mise will re-use .tool-versions files in your home directory or in project directories. It will not, however, re-use tools installed by asdf. It is possible to just let mise use the files downloaded by asdf by moving the directories around but it's not officially supported. It's probably faster to just mise install everything than debugging what went wrong.

Install global plugins

If you had any tools installed globally, you can just re-install these by cding to your home directory and running mise install.

Install local plugins

For each project that has a .tool-versions, you'll have to run mise install again. mise will tell you which plugins are missing on cding to the directory though.

Upgrade tools

Upgrading tools works with mise upgrade or mise up, but won't work with pinned version numbers in .tool-versions. For tools used globally, migration from .tool-versions to a mise config file (which supports latest as a version string) is easy:

$ mkdir -p ~/.config/mise/config.toml
$ echo '[tools]' > ~/.config/mise/config.toml
$ sed -i 's/\([^ ]*\).*/\1 = "latest"/' .tool-versions >> ~/.config/mise/config.toml

Now you can just run mise upgrade and it will bring all your tools to the latest version.

Emma Heinle
Last edit
Emma Heinle
License
Source code in this card is licensed under the MIT License.