Skip to content


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 variables
  • config_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:

PROJECT_NAME = "{{config_root | split(pat='/') | last}}"

Here's another using exec():

current = "{{exec(command='node --version')}}"

Or one that uses get_env():

my-plugin = "https://{{ get_env(name='GIT_USR', default='empty') }}:{{ get_env(name='GIT_PWD', default='empty') }}"

Licensed under the MIT License. Maintained by @jdx and friends.