mise use
- Usage:
mise use [FLAGS] [TOOL@VERSION]… - Aliases:
u - Effect: modifies state
- Source code:
src/cli/use.rs
Install a tool and add it to mise.toml
Installs the tool version if it is not already installed, then writes it to a config file. By default, this is mise.toml in the current directory. If multiple config files exist (e.g., both mise.toml and mise.local.toml), the lowest precedence file (mise.toml) will be used. See https://mise.jdx.dev/configuration.html#target-file-for-write-operations
In the following order:
- If
--globalis set, it will use the global config file. - If
--pathis set, it will use the config file at the given path. - If
--envis set, it will usemise.<env>.toml. - If
MISE_DEFAULT_CONFIG_FILENAMEis set, it will use that instead. - If
MISE_OVERRIDE_CONFIG_FILENAMESis set, it will use the first from that list. - Otherwise just "mise.toml" or global config if cwd is home directory.
Use MISE_GLOBAL_CONFIG_FILE to choose a different global config path.
Arguments
<TOOL@VERSION>— Tool to add to config filee.g.: node@20, cargo:ripgrep@latest, npm:prettier@3 If no version is specified, it defaults to @latest
Tool options can be set with this syntax:
mise use "cargo:ripgrep[features=pcre2]"
Flags
-e --env <ENV>— Create/modify an environment-specific config file like .mise.<env>.toml-f --force— Force reinstall even if already installed-g --global— Use the global config file (~/.config/mise/config.toml) instead of the local one-j --jobs <JOBS>— Number of jobs to run in parallel Values below 1 are treated as 1 Defaults to thejobssettingEnvironment Variable:
MISE_JOBS-n --dry-run— Perform a dry run, showing what would be installed and modified without making changes-p --path <PATH>— Specify a path to a config file or directoryIf a directory is specified, it will look for a config file in that directory following the rules above.
--dry-run-code— Like --dry-run but exits with code 1 if there are changes to makeThis is useful for scripts to check if tools need to be added or removed.
--fuzzy— Save fuzzy version to config filee.g.:
mise use --fuzzy node@20will save20as the version. This is the default behavior unlessMISE_PIN=1--minimum-release-age <MINIMUM_RELEASE_AGE>— Only install versions released before this date or older than this durationSupports absolute dates like "2024-06-01" and relative durations like "90d" or "1y".
--pin— Save the resolved concrete version to the config fileIf the request exactly matches an available release, that release is preferred over installed fuzzy matches. Use
prefix:to explicitly request recursive prefix matching. e.g.:mise use --pin node@20will save the resolved20.x.yversion SetMISE_PIN=1to make this the default behaviorConsider using mise.lock as a better alternative to pinning in mise.toml: https://mise.jdx.dev/configuration/settings.html#lockfile
--raw— Connect backend install command stdin/stdout/stderr directly to the terminal. Implies--jobs=1--remove <TOOL>— Remove the tool(s) from config file-h --help— Print help--postinstall <COMMAND>— Command to run after installing this tool
Examples:
# run with no arguments to use the interactive selector
$ mise use
# set the current version of node to 20.x in mise.toml of current directory
# will write the fuzzy version (e.g.: 20)
$ mise use node@20
# run a command after installing a tool
$ mise use --postinstall "mbx setup --defaults" mr-boxington
# associate a different postinstall command with each tool
$ mise use --postinstall "setup-a" tool-a --postinstall "setup-b" tool-b
# set the current version of node to 20.x in ~/.config/mise/config.toml
# will write the precise version (e.g.: 20.0.0)
$ mise use -g --pin node@20
# sets .mise.local.toml (which is intended not to be committed to a project)
$ mise use --env local node@20
# sets .mise.staging.toml (which is used if MISE_ENV=staging)
$ mise use --env staging node@20