LinuxCommandLibrary

asdf

Manage multiple language runtime versions

TLDR

List all available plugins

$ asdf plugin list all
copy

Install a plugin
$ asdf plugin add [name]
copy

List all available versions for a package
$ asdf list all [name]
copy

Install a specific version of a package
$ asdf install [name] [version]
copy

Set global version for a package
$ asdf set -u [name] [version]
copy

Set local version for a package
$ asdf set [name] [version]
copy

See the current version used for a package
$ asdf current [name]
copy

SYNOPSIS

asdf <command> [<args>] | asdf [--help] [--version] [--version-report]

PARAMETERS

--help
    Show help for asdf or a subcommand

--version
    Display asdf version

--version-report
    Show version details including plugins

plugin-add <name> [<git-repo>]
    Add a plugin from git repo

plugin-list [--urls]
    List installed plugins (with URLs if flag)

plugin-list-all
    List all available plugins

plugin-update [<name>]
    Update plugins or specific one

plugin-remove <name>
    Remove a plugin

install <plugin> [<version>|ref:tag:branch]
    Install specific version or latest

uninstall <plugin> <version>
    Uninstall a version

list [<plugin>]
    List installed versions (all or per plugin)

list-all <plugin>
    List all available versions for plugin

current [<plugin>]
    Show current versions

global [<plugin> [<version>]]
    Set or show global versions

local [<plugin> [<version>]]
    Set or unset local .tool-versions

shell <plugin> <version>
    Temporarily activate version in shell

reshim <plugin>
    Regenerate shims after manual installs

where <plugin> [<version>]
    Show install path

which <plugin>
    Show shim path for current version

latest <plugin>
    Get latest version

DESCRIPTION

asdf is an extensible CLI tool for managing multiple versions of runtime environments on Unix-like systems.

It uses a plugin system to support tools like Node.js, Ruby, Python, Elixir, Java, PHP, and many others. Users add plugins for specific runtimes, install desired versions, and set them globally, locally per project, or per shell session.

Key benefits include simplicity, extensibility (community plugins), and cross-language support without tool-specific managers like nvm or rbenv. It modifies shell profiles (e.g., .bashrc, .zshrc) via shims for seamless version switching.

Installation typically involves cloning the repo from GitHub, running asdf install, and sourcing the setup script. Once set up, workflows are intuitive: asdf plugin add nodejs, asdf install nodejs latest, asdf global nodejs 20.10.0.

asdf shines in development environments needing reproducible setups across projects and teams.

CAVEATS

Not pre-installed; requires manual setup via git. Needs writable ~/.asdf. Plugins may have dependencies. .tool-versions files override shims. Avoid mixing with tool-specific managers.

INSTALLATION

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
. ~/.asdf/asdf.sh
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc

SHIM MECHANISM

asdf creates executable shims in ~/.asdf/shims/ that delegate to the correct version based on .tool-versions or global settings.
Run asdf reshim after external changes.

HISTORY

asdf originated in 2013 by Phil Woods as a Ruby version manager, inspired by rbenv. It evolved into a general-purpose tool with plugin support around 2017. Maintained by the community on GitHub, it reached v0.10+ by 2020 with improved stability and ergonomics. Widely used in modern devops and polyglot projects.

SEE ALSO

nvm(1), rbenv(1), pyenv(1), direnv(1)

Copied to clipboard