Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '22'
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
Expand Down Expand Up @@ -474,7 +477,9 @@ mise can also be configured via environment variables. The following options are

### `MISE_DATA_DIR`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For Windows-specific defaults, it is more consistent and platform-appropriate to use Windows environment variable syntax (%VARIABLE%) and backslashes for paths. Mixing Unix-style $XDG_DATA_HOME with Windows-style %LOCALAPPDATA% on the same line can be confusing.

Suggested change
Default (Windows): %LOCALAPPDATA%\mise or %XDG_DATA_HOME%\mise

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
Expand All @@ -484,6 +489,7 @@ across machines.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the MISE_DATA_DIR section, the Windows default for MISE_CACHE_DIR should use consistent Windows syntax for environment variables and path separators.

Suggested change
Default (Windows): %TEMP%\mise or %XDG_CACHE_HOME%\mise

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.
Expand All @@ -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.

Expand Down
14 changes: 11 additions & 3 deletions docs/dev-tools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-tools/shims.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,39 @@ 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The note refers to mise.toml, but the example immediately preceding it shows the global configuration file ~/.config/mise/config.toml. To avoid confusion, it's better to use a more generic term like "configuration file" or explicitly mention both.

Suggested change
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.
You can also edit the configuration file 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.

::: 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`:
Expand Down
5 changes: 5 additions & 0 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ preinstall = "echo 'I am about to install tools'"
postinstall = "echo 'I just installed tools'"
```

::: warning
The syntax is `[hooks]` with `postinstall = "..."`, **not** `[hooks.postinstall]` with `run = "..."`.
The `[hooks.<name>]` table syntax is only used for [shell hooks](#shell-hooks) below.
:::

The `postinstall` hook receives a `MISE_INSTALLED_TOOLS` environment variable containing a JSON array of the tools that were just installed:

```toml
Expand Down
Loading