ASDF is a tool version manager. It allows developers to manage multiple versions of different programming languages, runtimes, and other development tools on a single system.
Fun fact: The name "asdf" comes from the first four letters on the left side of your keyboard. Try finding them!
Homepage: https://asdf-vm.com/
.tool-versions
file to specify the versions of all tools used in a project..tool-versions
file can be committed to version control systems like Git, ensuring all team members use the same tool versions..tool-versions
file and executes the specified version of the tool.Let's say you have Python 3.8 and 3.9 installed via asdf, and your project's .tool-versions
specifies Python 3.9.5.
python
in the terminal..tool-versions
file.This process happens transparently and quickly, so it feels like you're just running Python normally.
Prepare Your System: First, ensure your system is up-to-date:
$ sudo apt update && sudo apt upgrade
Install required dependencies:
$ sudo apt install curl git
Install asdf:
$ cd ~ && git clone https://github.com/asdf-vm/asdf.git ~/.asdf
Add the following to ~/.bashrc or ~/.zshrc:
. "$HOME/.asdf/asdf.sh"
Restart your shell or source the configuration file
Verify installation:
$ asdf --version
Add a plugin:
$ asdf plugin add []
# asdf plugin add nodejs
List All Available Versions:
$ asdf list all
# asdf list all nodejs
Install a version:
$ asdf install
# asdf install nodejs 18.0.0
List Installed Versions:
$ asdf list
# asdf list nodejs
Set a local version (in current directory):
$ asdf local
# asdf local nodejs 18.0.0
local writes the version to $PWD/.tool-versions, creating it if needed.