How asdf-vm/asdf works
asdf is a per-project runtime-version manager exposed through one CLI and extended by language plugins. The main flow is command invocation, configuration and version selection, then plugin-driven install or executable dispatch through generated shims. The graph also preserves plugin discovery, shell completion, legacy-version support, and execution helpers documented or referenced by the source index. Edges reflect visible imports/calls or README capabilities; unsampled implementation details are omitted rather than inferred.
Main entry points: cli.go Command router · plugins.go Plugin manager · versions.go Version lifecycle · shims.go Executable shims
Components 17
CLI experience
- Command router
internal/cli/cli.go - Shell completion
internal/completions/completions.go
Version selection
- Configuration
internal/config/config.go - Version files
internal/toolversions/toolversions.go - Version resolver
internal/resolve/resolve.go - Legacy version files
internal/plugins/plugins.go
Plugin management
- Plugin manager
internal/plugins/plugins.go - Plugin index
internal/pluginindex/pluginindex.go - Git operations
internal/git/git.go
Runtime operations
- Version lifecycle
internal/versions/versions.go - Install registry
internal/installs/installs.go - Executable shims
internal/shims/shims.go
Execution support
- Runtime environment
internal/execenv/execenv.go - Process execution
internal/execute/execute.go - Lifecycle hooks
internal/hook/hook.go - Data paths
internal/data/data.go
Other components
- Shell user
Connections 28
- Shell user → Command router: runs commands
README.md - Command router → Configuration: loads settings
internal/cli/cli.go - Command router → Shell completion: offers completion
internal/cli/cli.go - Command router → Plugin manager: manages plugins
internal/cli/cli.go - Command router → Plugin index: lists plugins
internal/cli/cli.go - Command router → Version resolver: resolves versions
internal/cli/cli.go - Command router → Version lifecycle: runs lifecycle
internal/cli/cli.go - Command router → Executable shims: dispatches tools
internal/cli/cli.go - Command router → Lifecycle hooks: runs hooks
internal/cli/cli.go - Command router → Runtime environment: prepares environment
internal/cli/cli.go - Version resolver → Version files: reads version files
internal/resolve/resolve.go - Version resolver → Plugin manager: parses legacy files
internal/resolve/resolve.go - Command router → Legacy version files: supports migration
README.md - Plugin manager → Git operations: clones and updates
internal/plugins/plugins.go - Plugin index → Git operations: refreshes index
internal/pluginindex/pluginindex.go - Version lifecycle → Plugin manager: runs callbacks
internal/versions/versions.go - Version lifecycle → Install registry: checks installations
internal/versions/versions.go - Version lifecycle → Lifecycle hooks: runs lifecycle hooks
internal/versions/versions.go - Executable shims → Version resolver: selects versions
internal/shims/shims.go - Executable shims → Install registry: finds executables
internal/shims/shims.go - Executable shims → Plugin manager: runs shim callbacks
internal/shims/shims.go - Executable shims → Lifecycle hooks: runs reshim hooks
internal/shims/shims.go - Runtime environment → Plugin manager: queries plugin
internal/execenv/execenv.go - Runtime environment → Process execution: executes command
internal/execenv/execenv.go - Git operations → Process execution: runs Git commands
internal/git/git.go - Plugin manager → Data paths: locates plugin data
internal/plugins/plugins.go - Install registry → Data paths: maps install paths
internal/installs/installs.go - Version lifecycle → Version files: parses version values
internal/versions/versions.go