asdf-vm / asdf-vm/asdf

Auto-install missing versions in asdf local

Open
#1,856 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

Copied from https://github.com/asdf-vm/asdf/pull/1714

I frequently want to be able to upgrade my `.tool-versions` straight to the newest version of a plugin with the `asdf local` command. At the moment, the first repository i perform this on, i'll get an error that the latest version isn't installed:

```shellsession
$ asdf local ruby latest
version 3.3.0 is not installed for ruby ❌
```

Instead of having to read the latest version from the error output, then type, e.g., `asdf install ruby 3.3.0`, then redo my command, i'd like to be able to have `asdf local` do the installation automatically. This will save me a tedious manual step.

With this change, i can do it all in one go:

```shellsession
$ echo "local_command_auto_install_missing_version = yes" >> .asdfrc
$ asdf local ruby latest
...installs Ruby 3.3.0...
$ cat .tool-versions
ruby 3.3.0 🎉
```

## Other Information

Apologies for the PR spam. Hopefully this one will be acceptable. I previously misunderstood a few things about how asdf works under the hood – i think this is a better way to address what i actually wanted, namely less manual version swizzling 😁

Also, i'm happy to find a better name for the config option.

Contributor guide

Open the contributing guide

Research direction

Start at the asdf local command entry point and inspect how .asdfrc settings, plugin versions, and .tool-versions are handled. Verify the requested setting with the ruby latest example; done means asdf local installs a missing resolved version when configured and writes that version to .tool-versions, while preserving the current error behavior otherwise.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, ruby, shell
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.