asdf
1 is a tool version manager.
All tool version definitions are contained within one file (.tool-versions
2) which you can check in to your project's Git repository to share with your team.
asdf
- ensures teams are using the exact same versions of tools (for each project)
- supports Github Actions (you can use the same configuration for local dev machine and CI/CD workflows)
- support for many tools via a plugin system3
- is simple (it's a single Shell script you include in your Shell config)
-
Install asdf plugins & the tools for each project
-
For each of the projects, e.g.
node-19
,node-20
-
"Install" asdf plugins6 for tools defined in
.tool-versions
cat .tool-versions | awk '{print $1}' | xargs -I _ asdf plugin add _
[!IMPORTANT] You need to "install" plugin for a tool, before using
asdf
to install a version of that tool.e.g.
asdf plugin add node
[!TIP] Plugins are how
asdf
knows to handle different tools like Node.js, Ruby, ...
-
-
For each of the tool, install the version defined in
.tool-versions
asdf install
[!TIP] In
asdf
words,asdf install
"Installs all the package versions listed in the.tool-versions
file" -
-
Confirm that for each project, the correct version of tool is invoked
cd node-19 node -v # Should be v19.0.0 cd ../node-20 # node -v # Should be v20.0.0
cd kubectl-1.28.3 kubectl version # Client Version: v1.28.3 cd ../kubectl-1.29.4 # kubectl version # Client Version: v1.29.4
Caution
A completions that match a version of a tool is still an unsolved problem7.
Footnotes
-
https://asdf-vm.com/manage/configuration.html#tool-versions ↩
-
Support command completions from installed tools - Issue #752 ↩