Templates are used in the following locations:
.tool-versions
files.mise.toml
files for most configuration- (Submit a ticket if you want to see it used elsewhere!)
The following context objects are available inside templates:
env: HashMap<String, String>
– current environment variablesconfig_root: PathBuf
– directory containing the.mise.toml
file
As well as these functions:
exec(command: &str) -> String
– execute a command and return the output
Templates are parsed with tera—which is quite powerful. For example, this snippet will get the directory name of the project:
[env]
PROJECT_NAME = "{{config_root | split(pat='/') | last}}"
Here's another using exec()
:
[aliases]
current = "{{exec(command='node --version')}}"