asdf-vm / asdf-vm/asdf

Search for other executable on PATH if no .tool-versions and no global

Open
#1,314 7 comments 8 reactions 0 assignees View on GitHub
enhancement
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? Please describe

In my scenario I have the tool `terraform` installed globally via Homebrew where I always get the latest version and completion automatically. Sometimes I need an older version of Terraform in that case I want to use asdf. I would like Asdf to look for another executable on PATH if no .tool-versions and no global version is available before erroring out.

### Describe the proposed solution

Adjust asdf maybe via a flag to look for another fitting executable on PATH if no .tool-versions can be found and no global version has been set for a package.

```shell
if tool_version_file_somewhere; then
# continue as usual
elif global_version_set; then
# continue as usual
elif exe_in_path_other_than_asdf_shim; then
# call this exe with args
else
# print error "No version is set for command..."
fi
```

### Describe similar `asdf` features and why they are not sufficient

Using the globals feature of Asdf is not sufficient in comparison to Homebrew. Homebrew handles automatic updates and completion.

### Describe other workarounds you've considered

- Using asdf globals instead of Homebrew for packages I want to always keep up to date and globally available.
- Monkeypatch asdf. Could be possible if overall modification is feasible because I use Ansible to bootstrap my environments.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the asdf shim handles a missing .tool-versions file and absent global version, including where it emits "No version is set for command." Compare that flow with the proposed PATH fallback and flag behavior; done means an executable other than the asdf shim is selected only in the requested case without changing normal version resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, shell
Domain
cli, tooling
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.