Skip to content

Configuration Format Specification

James C Craven edited this page Mar 22, 2026 · 5 revisions

Mkdev is configured via a configuration file located at $XDG_CONFIG_HOME/mkdev/config.toml. A default one is generated the first time mkdev attempts to interact with it if one does not exist, and can be edited from that point on.

Warning

This wiki page is correct for v3.4.1, and will no longer be updated.

For mkdev versions 3.4.2 and above, use man 5 mkdev-config instead.

For version 3.4.0, the option recipe_fmt::recipes_suffix did not exist. For versions <= 3.3.0 the entire recipe_fmt table did not exist.

Default Configuration File

[subs]
day = "date +%d"
dir = "mk::dir"
month = "date +%m"
name = "mk::name"
user = "whoami"
year = "date +%Y"

[recipe_fmt]
recipes_join = "\n"
recipes_suffix = "\n"
recipe_fmt = "{name} ({langs}){desc}"
name_fmt = "{name}"
name_bold = true
desc_fmt = "\n  {desc}"
lang_fmt = "{lang}"
lang_colour = true
langs_join = " "

Format Specification

Top-Level Keys

Key Type Default Description
recipe_dir path (optional) None (evaluates to $XDG_DATA_HOME/mkdev) Path to the directory where recipes are read from and saved to.
subs table See [subs] User-defined substitution variables for use when building recipes.
recipe_fmt table See [recipe_fmt] Formatting options for recipe display.

Table [subs]

A flat table of user-defined substitution variables. Each entry maps a variable name to a command whose output will be substituted when a recipe is instantiated.

Key Type Description
(any) command (string) A shell command or mkdev escape to be substituted.

Default Values

Key Value
dir mk::dir
name mk::name
user whoami
day date +%d
month date +%m
year date +%Y

Table [recipe_fmt]

Controls how recipes are rendered to the terminal.

Top-Level Display

Key Type Default Description
recipes_join string "\n" The string used to join multiple formatted recipes in a listing.
recipes_suffix string "\n" The string that comes after all recipes are printed.
show_descriptions bool (optional) None When set, foreces the description to either be shown or not.
recipe_fmt string "{name} ({langs}){desc}" Template for rendering a single recipe. Supports {name}, {langs}, and {desc} placeholders.

Name Formatting

Key Type Default Description
name_fmt string "{name}" Template for the recipe name. Supports {name}.
name_bold bool true Whether the recipe name is rendered in bold.

Description Formatting

Key Type Default Description
desc_fmt string "\n {desc}" Template for the recipe description. Supports {desc}. Omitted when absent.

Language Formatting

Key Type Default Description
lang_fmt string "{lang}" Template for each individual language tag. Supports {lang}.
lang_colour bool true Whether language tags are rendered with colour.
langs_join string " " The string used to join multiple language tags within a single recipe row.

Type Definitions

  1. string — A UTF-8 string value.
  2. bool — A boolean: true or false.
  3. path — A filesystem path to a file or directory.
  4. command — One of:
    • A shell command passed to the operating system, e.g., ls -l | grep foo
    • A mkdev escape value:
      • mk::dir — The name of the directory in which the recipe is being instantiated.
      • mk::name — The project name as provided by mk evoke -n NAME.
  5. table — A TOML table introduced by a [TABLE_NAME] header, e.g., [subs].

Clone this wiki locally