Add ASDF_AUTO_INSTALL configuration option
- 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
Sometimes I am running Terraform or OpenTofu in automation and want the user to be able to specify the version of Terraform or OpenTofu that they are using for this specific directory. I do not want to have to dictate or pre-install all possible versions into that environment.
### Describe the proposed solution
I think this should be a configuration setting like `ASDF_AUTO_INSTALL` that works similarly to [TENV_AUTO_INSTALL](https://github.com/tofuutils/tenv?tab=readme-ov-file#global-tenv-environment-variables). This flag could be set as an environment variable or in `~/.asdfrc`.
### Describe similar `asdf` features and why they are not sufficient
The current workflow causes an error if the version of the tool is not already installed and requires manual intervention to run the install command for that version. This is not viable in automation.
### Describe other workarounds you've considered
We have to use tenv which supports this capability instead of `asdf` so we have tooling sprawl and inconsistency when we would much prefer to just use `asdf` consistently in both automation and local development. This also forces us to use the `legacy_version_file` option instead of putting our Terraform or OpenTofu versions in `.tool-versions`, which has negative impacts on the consistency, maintainability, and how centralized our tool version management is.
We could potentially write our own custom tooling for the automation environment to detect and install the version dynamically, but that defeats the whole point of using `asdf`.
Prior related issues that are no longer open:
- https://github.com/asdf-vm/asdf/issues/1606
- https://github.com/asdf-vm/asdf/issues/2061
Contributor guide
Research direction
The issue names no source files or tests. Start by tracing how asdf reads ~/.asdfrc and environment variables, then follow the missing-version path for versions declared in .tool-versions; done means a documented ASDF_AUTO_INSTALL setting can trigger the required installation in automation without manual intervention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- 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