diff --git a/docs/configuration.md b/docs/configuration.md index 29c82381eb..c0065453fa 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -131,18 +131,21 @@ $ mise set NODE_ENV=production # writes to mise.toml ::: -Here is what a `mise.toml` looks like: +Here is what a typical `mise.toml` looks like: ```toml +[tools] +node = '24' +python = '3.12' + [env] -NODE_ENV = 'production' +NODE_ENV = 'development' -[tools] -terraform = '1.0.0' -erlang = '24.0' +[tasks.dev] +run = 'npm run dev' -[tasks.build] -run = 'echo "running build tasks"' +[tasks.test] +run = 'pytest' ``` `mise.toml` files are hierarchical. The configuration in a file in the current directory will @@ -474,7 +477,9 @@ mise can also be configured via environment variables. The following options are ### `MISE_DATA_DIR` -Default: `~/.local/share/mise` or `$XDG_DATA_HOME/mise` +Default (Linux): `~/.local/share/mise` or `$XDG_DATA_HOME/mise` +Default (macOS): `~/.local/share/mise` or `$XDG_DATA_HOME/mise` +Default (Windows): `%LOCALAPPDATA%\mise` or `$XDG_DATA_HOME/mise` This is the directory where mise stores plugins and tool installs. These are not supposed to be shared @@ -484,6 +489,7 @@ across machines. Default (Linux): `~/.cache/mise` or `$XDG_CACHE_HOME/mise` Default (macOS): `~/Library/Caches/mise` or `$XDG_CACHE_HOME/mise` +Default (Windows): `%TEMP%\mise` or `$XDG_CACHE_HOME/mise` This is the directory where mise stores internal cache. This is not supposed to be shared across machines. It may be deleted at any time mise is not running. @@ -504,7 +510,7 @@ This is the directory where mise stores system-wide configuration. ### `MISE_GLOBAL_CONFIG_FILE` -Default: `$MISE_CONFIG_DIR/config.toml` (Usually ~/.config/mise/config.toml) +Default: `$MISE_CONFIG_DIR/config.toml` (Usually `~/.config/mise/config.toml`) This is the path to the config file. diff --git a/docs/dev-tools/index.md b/docs/dev-tools/index.md index dda923257a..28489daa56 100644 --- a/docs/dev-tools/index.md +++ b/docs/dev-tools/index.md @@ -13,7 +13,7 @@ To know which tool version to use, mise will typically look for a `mise.toml` fi ```toml [mise.toml] [tools] -node = '22' +node = '24' python = '3' ruby = 'latest' ``` @@ -275,14 +275,22 @@ mise ~/my-project/mise.toml tools: node@24.x.x # mise.toml created/updated `mise use node@24` will install the latest version of node-24 and create/update the `mise.toml` -config file in the local directory. Anytime you're in that directory, that version of `node` will be -used. +config file in the local directory. The resulting file looks like this: -`mise use -g node@24` will do the same but update the [global config](/configuration.html#global-config-config-mise-config-toml) (~/.config/mise/config.toml) so +```toml [mise.toml] +[tools] +node = "24" +``` + +Anytime you're in that directory, that version of `node` will be used. + +`mise use -g node@24` will do the same but update the [global config](/configuration.html#global-config-config-mise-config-toml) (`~/.config/mise/config.toml`) so unless there is a config file in the local directory hierarchy, node-24 will be the default version for the user. +You can also edit `mise.toml` directly instead of using `mise use` — the effect is the same. Run `mise install` after editing to install any new tools. + ### [`mise install`](/cli/install) `mise install` will install but not activate tools—meaning it will download/build/compile the tool diff --git a/docs/dev-tools/shims.md b/docs/dev-tools/shims.md index f4e23ffa69..4870550699 100644 --- a/docs/dev-tools/shims.md +++ b/docs/dev-tools/shims.md @@ -49,7 +49,7 @@ ls -l ~/.local/share/mise/shims/node # [...] ~/.local/share/mise/shims/node -> ~/.local/bin/mise ``` -By default, the shim directory is located at `~/.local/share/mise/shims`. When installing a tool (for example, `node`), `mise` will add some entries for every binary provided by this tool in the `shims` directory (for example, `~/.local/share/mise/shims/node`). +By default, the shim directory is located at `~/.local/share/mise/shims` (on Windows: `%LOCALAPPDATA%\mise\shims`). When installing a tool (for example, `node`), `mise` will add some entries for every binary provided by this tool in the `shims` directory (for example, `~/.local/share/mise/shims/node`). ```sh mise use -g node@20 diff --git a/docs/getting-started.md b/docs/getting-started.md index efef22b60f..3ac2bb2a81 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -294,8 +294,47 @@ mise use --global github:BurntSushi/ripgrep rg --version ``` +Each `mise use` command above updates your config file. For example, after running all three globally, your `~/.config/mise/config.toml` would contain: + +```toml [~/.config/mise/config.toml] +[tools] +"npm:@anthropic-ai/claude-code" = "latest" +"pipx:black" = "latest" +"github:BurntSushi/ripgrep" = "latest" +``` + +You can also edit `mise.toml` directly instead of using `mise use` — the effect is the same. Run `mise install` after editing to install the tools. + See [Backends](/dev-tools/backends/) for more ecosystems and details. +## Trusting config files {#trust} + +When you or a teammate adds a `mise.toml` to a project, mise will prompt you to trust it before it runs any env directives or hooks: + +``` +mise ~/my-project/mise.toml is not trusted. Trust it? [y/n] +``` + +This is a security measure — config files can execute arbitrary code via `[env]` directives, hooks, and tasks. To trust a file, run: + +```sh +mise trust +``` + +This only needs to be done once per file. See [`mise trust`](/cli/trust) for more details. + +To disable trust prompts entirely, trust the root path: + +```sh +mise settings trusted_config_paths=["/"] +``` + +Or set the environment variable `MISE_TRUSTED_CONFIG_PATHS=/`. + +::: tip +`mise use` automatically trusts the file it creates, so you'll only see this prompt when pulling a config someone else wrote or when editing `mise.toml` by hand. +::: + ## 5. Setting environment variables {#environment-variables} Define environment variables in `mise.toml` — they'll be loaded whenever mise is activated or when using `mise exec`: diff --git a/docs/mise-cookbook/nodejs.md b/docs/mise-cookbook/nodejs.md index 862062c839..56f034dffa 100644 --- a/docs/mise-cookbook/nodejs.md +++ b/docs/mise-cookbook/nodejs.md @@ -110,7 +110,7 @@ This example uses `pnpm` as the package manager. This will skip installing depen ```toml [mise.toml] [tools] -node = '22' +node = '24' [hooks] # Enabling corepack will install the `pnpm` package manager specified in your package.json diff --git a/schema/mise.json b/schema/mise.json index 3362e156f2..a809e94a40 100644 --- a/schema/mise.json +++ b/schema/mise.json @@ -1583,7 +1583,7 @@ }, "trusted_config_paths": { "default": [], - "description": "This is a list of config paths that mise will automatically mark as trusted.", + "description": "This is a list of config paths that mise will automatically mark as trusted. Any config files under these paths will be trusted without prompting. Set to `[\"/\"]` to trust all config files, effectively disabling the trust mechanism.", "type": "array", "items": { "type": "string" diff --git a/settings.toml b/settings.toml index 26a127e631..a3fd924fa0 100644 --- a/settings.toml +++ b/settings.toml @@ -2179,7 +2179,9 @@ type = "Bool" [trusted_config_paths] default = [] -description = "This is a list of config paths that mise will automatically mark as trusted." +description = """This is a list of config paths that mise will automatically mark as \ +trusted. Any config files under these paths will be trusted without prompting. \ +Set to `["/"]` to trust all config files, effectively disabling the trust mechanism.""" env = "MISE_TRUSTED_CONFIG_PATHS" parse_env = "list_by_colon" rust_type = "BTreeSet"