Consider adding `-l`/`--local` flags and/or syncing command flags
Much like How I use mise from the docs, I've been taking advantage of .mise.local.toml. Ideally, I'd like to manage this by CLI as much as possible, but there are a few rough spots for me in the workflow—
- I've been typing
mise use -e locala lot, generally for projects where the maintainer wouldn't want. This one is pretty fine on its own. - I generally check my various tool settings files into
gitfor use across multiple machines, but I personally consider the list of applications and their installed versions to be more a property of the machine's state rather than configuration, if that distinction makes sense. I considered checking in~/.config/mise/config.tomlwith settings and using~/.config/mise/config.local.tomlfor managing tool versions, but I struggled to make this work through the CLI. The first thing I tried wasmise use -g -e local, but it looks like the-eflag overrides both-gand-p(if a directory is specified). It seems like I could do this by CLI with-p ~/.config/mise/config.local.toml, which works (even though it's a bit verbose). For now I haven't been checking my config into VCS at all, which isn't a huge deal, because there's only 2 things I've been setting. - For setting env vars, I type
mise set -f .mise.local.toml. A little more verbose, again probably okay in isolation, but It takes some getting used to that the config path options foruseandenvdiffer. - I haven't really had a need for
mise settingswith any file other than the default global config file, but I was surprised to see (a) that there was no way to do this by CLI, and (b) that=signs were disallowed
The grand sum of those use cases is that I would write to .local.toml files by CLI using 3 different syntaxes of varying verbosity, depending on the command:
-
mise use -e local [email protected] -
mise use -p ~/.config/mise/config.local.toml [email protected] -
mise set -f .mise.local.toml foo=val - Settings in
~/.config/mise/config.local.tomlcannot be changed via CLI
Ideally what I would like to be able to do is this:
-
mise use -l [email protected] -
mise use -gl [email protected] -
mise set -l foo=val -
mise settings set -l foo=val(with rules on=consistent withmise set)
Alternatively or additionally, making the syntax consistent between all commands without defining any new flags would go a long way:
-
mise use -e local [email protected](currently implemented) -
mise use -g -e local [email protected] -
mise set -e local foo=val -
mise settings set -e local foo=val
I think a local flag makes sense. Maybe also --env could be used without an argument to leverage MISE_ENV to find the current one though I dislike optional parameters on args
Yeah I'm not sure there's a great way to make a flag have an optional argument without requiring = (e.g., --boolean=false vs --boolean), and if --env already exists it's probably too late for that.
You could always add a separate flag like --auto-env, although I'm not sure I'd personally take advantage of an automatic env discovery flag either way.