asdf
Asdf is an all-in-one tool manager designed to replace individual language specific version managers such as pyenv, nvm, rbenv, etc. Asdf operates on a plugin based system to support the different tools. A full list of the supported plugins can be found here https://github.com/asdf-community. Asdf uses shims similar to pyenv, nvm, etc. and has the ability to install a tool globally, within a specific directory, or within a shell.
Installing a tool with asdf is a multistep process:
- Install asdf
- Install the plugin corresponding to the desired language/tool (ex: nodejs, golang, python, etc…)
asdf plugin add <name>
- Install the desired version of the language/tool
asdf install <name> <version>
- Load the language/tool to the global or local .tool-versions before it can used
asdf local <name> <version>
orasdf global <name> <version>
. Installing the language/tool to locally means it can be used in the current directory or any subdirectories. Installing to global means that it can be used anywhere on the system. Tools that are not loaded cannot be used.
Additionally, asdf supports using a .tool-versions
file to install multiple tools.
Running asdf install
in a directory with a .tool-versions
will install the tools listed
in the file. The installed tools are only be available in that directory or any subdirectories.
Codify Resources
The Codify asdf resources are designed to replicate the same design model as the original tool.
- asdf: Installs asdf itself and optionally this resource can install plugins (as an added feature to help improve usability)
- asdf-plugin: Installs an asdf plugin and optionally and install specific versions of the tool using the plugin (added feature).
- asdf-local: Loads the asdf tool version locally to a directory or multiple directories.
- asdf-global: Loads the asdf tool version globally.
- asdf-install: Installs the
.tool-versions
file in a directory or installs a version of a tool. asdf-install will add missing plugins automatically (added feature)
Parameters:
- plugins: (array[string]) An optional array of plugins to install. The plugin names must match the names found in https://github.com/asdf-community.
Example usage:
Install asdf:
Install asdf and the nodejs
and golang
plugins:
A full config for installing a .tool-versions file
The asdf-install
resource will automatically install missing plugins if they exist in a
.tool-versions
file. This is additional functionality added by Codify. The config below
installs asdf, installs the necessary plugins and then installs the tool versions specified
in ~/path/to/dir/.tool-versions
.
Installing nodejs globally
Asdf provides the latest
keyword shortcut. Other-wise fully
qualified version (down to the patch level) must be used. This config will install asdf,
the nodejs plugin, install node versions latest
and 20.18.0
, and then load
20.18.0
as the globally available version.