jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.03k stars 210 forks source link

`mise use|install` tool options #2309

Open jdx opened 1 week ago

jdx commented 1 week ago

while not heavily used, mise does support "tool opts", e.g.:

[tools]
# send arbitrary options to the plugin, passed as:
# MISE_TOOL_OPTS__FOO= bar
mytool = { version = '3.10', foo = 'bar' }

In general, I prefer using settings instead of this because usually these are things that are specific to the current system or user preferences and not the tool itself, however it does have some potential use-cases. This traditionally has not been documented (though I'm going to fix that today). It's also not supported by asdf so it would be mise-only functionality in asdf plugins.

The other barrier for this has been the lack of a CLI interface—it required manually modifying mise.toml. Adding support for this in mise use I think could be done, however because mise use accepts multiple tools we would need to find a way to make that work. I have not done this before but I think clap might support a way to do something like this:

mise use --opt1=a tool1 --opt2=b tool2

where in this case, "opt1" would be set only for tool1 and "opt2" would only be set for tool2 of course.