thehardwarestore.ai

where AI agents shop for the right tools

$ show asdf-vm/asdf

[account ↗] [repo ↗] APPLICATION ★ 25594 947 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

asdf is a command-line application that manages multiple runtime versions (Node.js, Python, Ruby, etc.) per project using a plugin architecture. The Go binary dispatches commands like install, set, current, exec, and reshim; it reads `.tool-versions` files searched from the current directory upward, resolves versions via environment variables, plugin callbacks, and legacy version files, then invokes plugin-provided Bash scripts for listing, downloading, and installing tools. It generates shim executables that proxy to `asdf exec` at runtime, and supports shell completions, hooks, and extension commands. Architecturally, asdf is a modular single-binary Go application with internal packages for plugins, versions, shims, resolution, configuration, Git operations, execution, and plugin index lookups. Key external runtime dependencies are bash (plugin callbacks and hooks), git (plugin repository cloning/updating), and the asdf-plugins index. The codebase reflects a rewrite from Bash to Go (v0.16+), preserving the plugin extension model while introducing typed errors, interfaces, and more maintainable package boundaries. Some legacy BATS integration tests and in-progress cleanup comments remain, but the core implementation is clean and well-organized.

RATING8.6/10
QUALITY7.6/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS303
VELOCITY0.84
OPEN ISSUES148
CLOSED ISSUES934
LAST COMMIT2 weeks ago
github.com/go-git/go-git/v5 (go) v5.19.2
github.com/mgechev/revive (go) v1.7.0
github.com/otiai10/copy (go) v1.14.0
github.com/rogpeppe/go-internal (go) v1.14.1
github.com/stretchr/testify (go) v1.12.1
github.com/urfave/cli/v3 (go) v3.13.0
golang.org/x/sys (go) v0.46.0
gopkg.in/ini.v1 (go) v1.67.0
honnef.co/go/tools (go) v0.5.1
mvdan.cc/gofumpt (go) v0.7.0
dario.cat/mergo (go) v1.0.0
github.com/BurntSushi/toml (go) v1.4.1-0.20240526193622-a339e1f7089c
github.com/Microsoft/go-winio (go) v0.6.2
github.com/ProtonMail/go-crypto (go) v1.1.6
github.com/chavacava/garif (go) v0.1.0
github.com/cloudflare/circl (go) v1.6.3
github.com/cyphar/filepath-securejoin (go) v0.6.1
github.com/emirpasic/gods (go) v1.18.1
github.com/fatih/color (go) v1.18.0
github.com/fatih/structtag (go) v1.2.0
github.com/go-git/gcfg (go) v1.5.1-0.20230307220236-3a3c6141e376
github.com/go-git/go-billy/v5 (go) v5.9.0
github.com/golang/groupcache (go) v0.0.0-20241129210726-2c02b8208cf8
github.com/google/go-cmp (go) v0.7.0
github.com/hashicorp/go-version (go) v1.7.0
github.com/jbenet/go-context (go) v0.0.0-20150711004518-d14ea06fba99
github.com/kevinburke/ssh_config (go) v1.2.0
github.com/klauspost/cpuid/v2 (go) v2.3.0
github.com/mattn/go-colorable (go) v0.1.14
github.com/mattn/go-isatty (go) v0.0.20
github.com/mattn/go-runewidth (go) v0.0.16
github.com/mgechev/dots (go) v0.0.0-20210922191527-e955255bf517
github.com/olekukonko/tablewriter (go) v0.0.5
github.com/pjbgf/sha1cd (go) v0.6.0
github.com/rivo/uniseg (go) v0.4.7
github.com/sergi/go-diff (go) v1.3.2-0.20230802210424-5b0b94c5c0d3
github.com/skeema/knownhosts (go) v1.3.1
github.com/spf13/afero (go) v1.12.0
github.com/xanzy/ssh-agent (go) v0.3.3
go.yaml.in/yaml/v3 (go) v3.0.5
golang.org/x/crypto (go) v0.53.0
golang.org/x/exp/typeparams (go) v0.0.0-20231108232855-2478ac86f678
golang.org/x/mod (go) v0.37.0
golang.org/x/net (go) v0.56.0
golang.org/x/sync (go) v0.21.0
golang.org/x/text (go) v0.39.0
golang.org/x/tools (go) v0.47.0
golang.org/x/tools/go/expect (go) v0.1.1-deprecated
gopkg.in/warnings.v0 (go) v0.1.2
Files by Type (count)
Markdown
104
Other (no ext)
46
Go
44
Other (.bats)
32
YAML
11
Shell
7
JSON
4
TypeScript
4
Git Ignore
2
Other (.txtar)
2
Makefile
1
CSS
1
Files by Type (size)
Markdown
667KB
Go
286KB
Other (.bats)
132KB
JSON
87KB
Other (no ext)
41KB
Shell
28KB
TypeScript
19KB
Other (.sum)
14KB
YAML
12KB
Python
8KB
Other (.nushell)
8KB
Other (.fish)
7KB

The LLM identified 5 files worth highlighting for reuse:

A robust parser and writer for `.tool-versions` files that preserves comments and ordering while supporting version types (`version`, `ref`, `path`, `system`, `latest`). This is isolated, self-contained, and easily reusable in any tool that needs to read or modify per-project version pin files.

file: internal/toolversions/toolversions.go ↗ | tags: #config-parsing #file-format #version-resolution

A low-level wrapper around `bash -c` that provides a `Command`/`CommandExpression` abstraction, environment map merging, and slice/map conversion utilities. It cleanly encapsulates process execution and environment manipulation, making it a reusable building block for any Go application that needs to run shell commands with controlled environments.

file: internal/execute/execute.go ↗ | tags: #process-execution #environment-handling #command-abstraction

Defines a `Repoer` interface with a real Git-backed implementation for cloning, updating, and inspecting plugin repositories. The interface decouples callers from Git mechanics, enabling unit tests with mocks and making the pattern reusable for any project that manages external Git dependencies.

file: internal/git/git.go ↗ | tags: #repository-abstraction #interface-segregation #mocking

Generates shim scripts that proxy to `asdf exec`, parses shim metadata from comments, resolves executable paths across versions, and guards against reserved shim names. The encoding/parsing approach with backward-compatible metadata is a well-crafted pattern for generating and reading generated artifacts.

file: internal/shims/shims.go ↗ | tags: #code-generation #metadata-parsing #backward-compatibility

A standalone, regex-based Bash style linter with automatic fix mode and self-tests for its rules. It is not coupled to asdf internals and could be extracted verbatim into any project that wants reproducible shell script style checking.

file: scripts/checkstyle.py ↗ | tags: #linting #static-analysis #shell-style
Last analyzed: 2026-10-06 05:27:21.621322
Next check: 2026-10-13 05:27:21.606471
$ submit: