diff --git a/docs/configuration.md b/docs/configuration.md index 05cc5ee4f9..cca19e959c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -137,7 +137,18 @@ You can also have environment specific config files like `.mise.production.toml` ### `[tools]` - Dev tools -See [Tools](/dev-tools/). +See [Tools](/dev-tools/). In addition to specifying versions, each tool entry can include options such as: + +- `os`: Restrict installation to certain operating systems +- `install_env`: Environment vars used during install +- `postinstall`: Command to run after installation completes for that specific tool + +Examples: + +```toml +[tools] +node = { version = "22", postinstall = "corepack enable" } +``` ### `[env]` - Arbitrary Environment Variables diff --git a/docs/dev-tools/index.md b/docs/dev-tools/index.md index 2d9cb04b37..7769d56e8f 100644 --- a/docs/dev-tools/index.md +++ b/docs/dev-tools/index.md @@ -142,6 +142,21 @@ port = 6379 Internally, nested options are flattened to dot notation (e.g., `platforms.macos-x64.url`, `database.host`, `cache.redis.port`) for backend access. +### Tool postinstall commands + +Run a command immediately after a tool finishes installing by adding a `postinstall` field to that tool's configuration. This is separate from `[hooks].postinstall` and applies only to when a specific tool is installed. + +```toml +[tools] +node = { version = "22", postinstall = "corepack enable" } +``` + +Behavior: +- The command runs once the install completes successfully for that tool/version. +- The tool's bin path is on PATH during the command, so you can invoke the installed tool directly. +- Environment variables include `MISE_TOOL_INSTALL_PATH` pointing to the tool's install directory. +- If the install fails, the `postinstall` command is not run. + ## OS-Specific Tools You can restrict tools to specific operating systems using the `os` field: