asdf: A Universal Version Manager for Multiple Runtimes

Summary
asdf is an extendable command-line tool designed to manage multiple language runtime versions efficiently. It acts as a single, unified solution, replacing individual version managers like nvm or rbenv for various programming languages. With its plugin-based architecture, asdf provides consistent commands and project-specific version control across diverse development environments.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
asdf is a powerful and extendable version manager that simplifies the process of handling multiple runtime versions for various programming languages. Instead of juggling separate tools like nvm for Node.js, rbenb for Ruby, or pyenv for Python, asdf provides a single, consistent command-line interface. It supports a wide array of languages and tools through its robust plugin system, making it an indispensable tool for developers working with diverse technology stacks.
Installation
To get started with asdf, you typically need to clone the repository and set up your shell environment. The official documentation provides detailed, step-by-step instructions for installation on different operating systems and shell configurations. It is recommended to follow the guide on the official asdf-vm website for the most up-to-date and accurate installation process.
Examples
Once installed, asdf offers a straightforward workflow for managing runtimes. For instance, to install a specific version of Node.js, you would first add the Node.js plugin, then install the desired version, and finally set it globally or locally for a project.
# Example commands (refer to official docs for exact syntax)
asdf plugin add nodejs
asdf install nodejs 18.17.1
asdf global nodejs 18.17.1
asdf local nodejs 18.17.1
Similarly, you can manage other languages like Python, Ruby, Elixir, and more, all using the same asdf commands. The .tool-versions file in your project directory allows for automatic version switching as you navigate between projects.
Why use asdf?
asdf offers several compelling advantages for developers:
- Single CLI for multiple languages: Manage all your language runtimes with one tool.
- Consistent commands: Learn one set of commands for all supported languages.
- Single global configuration: Keep your default language versions organized in one place.
- Project-specific versions: Use a
.tool-versionsfile to define language versions per project. - Support for existing config files: Easily migrate with support for
.node-version,.nvmrc,.ruby-version, and similar files. - Automatic version switching: asdf automatically switches runtime versions as you traverse your directories.
- Simple plugin system: Extend asdf's capabilities by creating or installing plugins for any language or tool.
- Shell completion: Enjoy command completion for popular shells like Bash, Zsh, Fish, and Elvish.
Links
- Official Website & Documentation: asdf-vm.com
- GitHub Repository: asdf-vm/asdf
- All Plugins: asdf-vm/asdf-plugins
- Getting Started Guide: asdf-vm.com/guide/getting-started.html