aquaproj / aqua

Declarative CLI Version manager written in Go. Support Lazy Install, Registry, and continuous update with Renovate. CLI version is switched seamlessly
https://aquaproj.github.io
833 stars 37 forks source link

aqua as "universal interpreter" that installs dependencies of shell scripts on the fly #2973

Open reitzig opened 3 months ago

reitzig commented 3 months ago

Feature Overview

Looking at pkgx and their "universal interpreter" feature, I wonder if something similar would be feasible for aqua.

Why is the feature needed?

Makes dependencies of shell scripts explicit and painless to "install" -- as long as the user uses aqua, of course. ;)

Workaround

This script kind of works: reitzig/scripts:aquax

Avoiding the intermediate config file would be neater and probably more efficient, though. One might want to tailor the output to the use case, too.

Example Code

#!/usr/bin/env -S aquax +charmbracelet/gum +mikefarah/yq bash

gum log --level info "Aqua registry at $(yq '.registries.[] | select(.type == "standard") | .ref' < ~/.config/aqua/aqua.yaml)"

Or even:

#!/usr/bin/env -S aquax +charmbracelet/gum@v0.14.1 +mikefarah/yq>=4 bash

gum log --level info "Aqua registry at $(yq '.registries.[] | select(.type == "standard") | .ref' < ~/.config/aqua/aqua.yaml)"

NB: Fixed versions work with the workaround script; version ranges don't. (Don't think aqua supports them, either?)

Note

No response