docs/asdf-legacy-plugins.md
::: warning asdf plugins are considered legacy. New asdf and vfox plugins are not accepted into the mise registry for supply-chain security reasons — for registry submissions use the aqua (preferred) or github backend instead.
If you are writing a private/custom plugin (not for registry submission), prefer vfox plugins over asdf — they're written in Lua, work cross-platform (including Windows), and have access to built-in modules. See the feature comparison and hook migration table for details. :::
mise maintains compatibility with the asdf plugin ecosystem through its asdf backend. These plugins are considered legacy because they have limitations compared to mise's modern plugin system.
asdf plugins are shell script-based plugins that follow the asdf plugin specification. They were the original way to extend tool management in the asdf ecosystem and are now supported by mise for backward compatibility.
asdf plugins have several limitations compared to mise's modern plugin system:
Only use asdf plugins when:
For new tools, consider these alternatives first:
Most popular asdf plugins are available through mise's registry:
# Install from registry shorthand
mise use postgres@15
# This is equivalent to
mise use asdf:mise-plugins/mise-postgres@15
# Install plugin directly from repository
mise plugin install <plugin-name> <git-url>
# Example: PostgreSQL plugin
mise plugin install postgres https://github.com/mise-plugins/mise-postgres
# Add plugin manually
mise plugin add postgres https://github.com/mise-plugins/mise-postgres
# Install tool version
mise install [email protected]
# Use the tool
mise use [email protected]
asdf plugins follow this directory structure:
plugin-name/
├── bin/
│ ├── list-all # List all available versions
│ ├── download # Download source code/binary
│ ├── install # Install the tool
│ ├── latest-stable # Get latest stable version [optional]
│ ├── help.overview # Plugin description [optional]
│ ├── help.deps # Plugin dependencies [optional]
│ ├── help.config # Plugin configuration [optional]
│ ├── help.links # Plugin links [optional]
│ ├── list-legacy-filenames # Legacy version files [optional]
│ ├── parse-legacy-file # Parse legacy version files [optional]
│ ├── post-plugin-add # Post plugin addition hook [optional]
│ ├── post-plugin-update # Post plugin update hook [optional]
│ ├── pre-plugin-remove # Pre plugin removal hook [optional]
│ └── exec-env # Set execution environment [optional]
├── lib/ # Shared library code [optional]
└── README.md
Lists all available versions of the tool:
#!/usr/bin/env bash
# List all available versions
curl -s https://api.github.com/repos/owner/repo/releases |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/' |
sort -V
Downloads the tool source/binary:
#!/usr/bin/env bash
set -e
# Input variables from mise
# ASDF_INSTALL_TYPE (version or ref)
# ASDF_INSTALL_VERSION (version number or git ref)
# ASDF_INSTALL_PATH (where to install)
# ASDF_DOWNLOAD_PATH (where to download)
version="$ASDF_INSTALL_VERSION"
download_path="$ASDF_DOWNLOAD_PATH"
# Download logic here
curl -Lo "$download_path/archive.tar.gz" \
"https://github.com/owner/repo/archive/v${version}.tar.gz"
Installs the tool:
#!/usr/bin/env bash
set -e
# Input variables from mise
# ASDF_INSTALL_TYPE (version or ref)
# ASDF_INSTALL_VERSION (version number or git ref)
# ASDF_INSTALL_PATH (where to install)
# ASDF_DOWNLOAD_PATH (where source is downloaded)
install_path="$ASDF_INSTALL_PATH"
download_path="$ASDF_DOWNLOAD_PATH"
# Extract and install
cd "$download_path"
tar -xzf archive.tar.gz --strip-components=1
make install PREFIX="$install_path"
Set environment variables when executing tools:
#!/usr/bin/env bash
# Set environment variables
export TOOL_HOME="$ASDF_INSTALL_PATH"
export PATH="$ASDF_INSTALL_PATH/bin:$PATH"
Get the latest stable version:
#!/usr/bin/env bash
curl -s https://api.github.com/repos/owner/repo/releases/latest |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/'
List legacy version file names:
#!/usr/bin/env bash
echo ".tool-version"
echo ".tool-versions"
Parse legacy version files:
#!/usr/bin/env bash
cat "$1" | head -n 1
asdf plugins have access to these environment variables:
ASDF_INSTALL_TYPE - version or refASDF_INSTALL_VERSION - Version number or git refASDF_INSTALL_PATH - Installation directoryASDF_DOWNLOAD_PATH - Download directoryASDF_PLUGIN_PATH - Plugin directoryASDF_PLUGIN_PREV_REF - Previous git ref (for updates)ASDF_PLUGIN_POST_REF - New git ref (for updates)ASDF_CMD_FILE - Path to executable being run#!/usr/bin/env bash
set -euo pipefail # Exit on error, undefined vars, pipe failures
# Check dependencies
command -v curl >/dev/null 2>&1 || {
echo "Error: curl is required" >&2
exit 1
}
#!/usr/bin/env bash
# Detect platform
case "$(uname -s)" in
Darwin*) platform="darwin" ;;
Linux*) platform="linux" ;;
*) echo "Unsupported platform" >&2; exit 1 ;;
esac
case "$(uname -m)" in
x86_64) arch="amd64" ;;
arm64) arch="arm64" ;;
*) echo "Unsupported architecture" >&2; exit 1 ;;
esac
#!/usr/bin/env bash
# Parse semantic version
parse_version() {
local version="$1"
# Remove 'v' prefix if present
version="${version#v}"
echo "$version"
}
# Link plugin for development
mise plugin add my-plugin /path/to/local/plugin
# Test basic functionality
mise list-all my-plugin
mise install [email protected]
mise which my-plugin
# Enable debug mode
export MISE_DEBUG=1
# Or use --verbose flag
mise install --verbose [email protected]
Here's a minimal example for a fictional tool:
#!/usr/bin/env bash
# bin/list-all
curl -s "https://api.github.com/repos/example/tool/releases" |
grep '"tag_name":' |
sed -E 's/.*"v([^"]+)".*/\1/' |
sort -V
#!/usr/bin/env bash
# bin/download
set -e
version="$ASDF_INSTALL_VERSION"
platform=$(uname -s | tr '[:upper:]' '[:lower:]')
arch=$(uname -m)
url="https://github.com/example/tool/releases/download/v${version}/tool-${platform}-${arch}.tar.gz"
curl -fSL "$url" -o "$ASDF_DOWNLOAD_PATH/tool.tar.gz"
#!/usr/bin/env bash
# bin/install
set -e
cd "$ASDF_DOWNLOAD_PATH"
tar -xzf tool.tar.gz
cp tool "$ASDF_INSTALL_PATH/bin/"
chmod +x "$ASDF_INSTALL_PATH/bin/tool"
Consider migrating from asdf plugins to modern alternatives:
asdf plugins execute arbitrary shell scripts, which poses security risks: