asdf-vm / asdf-vm/asdf

Automatically warn/install versions on enter directory when mismatch with current

Open
#734 7 comments 1 reaction 0 assignees View on GitHub
enhancement help wanted proposal
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

**Is your feature request related to a problem?**

I am frustrated when I enter a directory containing a tool-version that is not installed and thus not used by asdf, then I don't use the expected tools. I am not warned about the mismatch between required tool (defined in `.tool-versions` and the one in `asdf current`).

Given a directory with a `.tool-versions`
When the user enters that directory or one of its children
Then asdf **warns** and/ask for **installation** of the tools versions defined in `.tool-versions`

**Describe the solution you'd like**

I would like that asdf detects that the current tools are not the one defined in the `.tool-versions` and install them automatically (or ask for install).

**Describe similar asdf features and why they are not sufficient**

asdf correctly **use** the tools but it did not warn/install them automatically

**Describe workarounds you've considered**

A shell plugin could detect that the current tools and the one in .tool-versions (in the hierarchy) do not match.
This plugin can warn the user that something is wrong and ask if it can install the tools.

Nvm (Node Version Manager) has [some instructions to do it](https://github.com/nvm-sh/nvm#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file).
This snippet will use or install (depending of the versions of node installed and declared).

**Additional context**

```
$ asdf version
v0.7.8-4a3e3d6
```

Contributor guide

Open the contributing guide

Research direction

Start by comparing the tools declared in `.tool-versions` with the output of `asdf current` while entering a directory or one of its children. Review the proposed shell-plugin workaround and the linked nvm instructions for the directory-entry behavior. Done means asdf detects mismatches and warns or requests installation of the declared versions without silently using different ones.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.