asdf is a version manager for :allthethings:. It replaces tools like gvm
, nvm
, rbenv
and pyenv
with a single CLI to rule them all making it the perfect tool for the polyglot programmer. It does this by leveraging its own project specific or system-wide config file (.tool-versions) or consuming the config file specific to each traditional version manager (.node-version, .nvmrc, .ruby-version).
Through its community and plugins, chances are whatever language you’re reaching for is supported and if not you could add support for it through your own plugin.
asdf
has become an indespensible tool in my day to day development and I couldn’t imagine going back to the bad-old-days of needing to remember how a half-dozen separate version managers worked in order to complete the task that I came there to do.
Installation
Dependencies
Installing asdf
git clone https://github.com/asdf-vm/asdf.git "$XDG_CONFIG_HOME"/asdf --branch v0.8.1
Add the following to the rc file for your shell (~/.bashrc, ~/.zshrc, etc.)
. "$XDG_CONFIG_HOME"/asdf/asdf.sh
Usage
Installing a plugin (nodejs)
asdf install nodejs latest
Use it system-wide
asdf global nodejs latest
Use it for a specific project
This makes all references to node in the CWD tied to the specified version
asdf local nodejs latest