Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Meta keys

A fenced block with the language meta (TOML) in a task section. Unknown keys and invalid values are an error, so a typo such as retires is caught instead of silently ignored:

Error: Invalid task file: task 'flaky': `meta` block: unknown key `retires` on line 1 (did you mean `retries`?)

imports and the other document-wide keys go in a meta block before the first heading. That block also accepts runtimes and default_task (Configuration).

KeyTypeDescription
dependsarray of stringsTasks to run first; each may carry arguments ("deploy env=prod")
onceboolRun at most once per run, even when called with different arguments
parallelboolRun depends and the items of list, glob and matrix loops concurrently
forarray, { glob }, { matrix } or { from }Run the task once per item (Loops)
asstringExtra variable name for the loop item (as = "file" sets MX_FILE)
deferarray of stringsTasks run after this one, even on failure (defer)
ifstringCondition; task skipped when false
retriesintegerExtra attempts after a failure
retry_delaydurationWait between attempts (default 1s)
timeoutdurationPer-attempt limit; exit 124
promptstringAsk for confirmation before running (Prompts)
ignore_errorboolTreat a failed run as success (Retries and Timeouts)
captureboolExpose stdout as MX_OUTPUT_<TASK> to dependents
sourcesarray of globsInput files for up-to-date checks and --watch; a !pattern excludes files (details)
statusarray of stringsShell commands; task skipped when all exit 0 (guide)
outputsarray of pathsFiles that must exist for the task to be considered up to date
paramsarray of strings or tablesNamed parameters: "name" (required), "name=value" (default) or { name, default, choices, desc } (guide)
requiresarray of stringsVariables that must be set and not empty (guide)
varstableNamed values: fixed, { sh = "command" } or { mq = "query", from = "file" }; ${NAME} refers to another (Variables)
envarray of KEY=VALUEDefault environment variables
dirstringWorking directory
dotenvarray of paths.env files to load (guide)
aliasarray of stringsAlternate names
privateboolHide from listings
importsarray of paths, globs or tablesDocument-wide only: files to import; a table takes path, as, optional and flatten (Importing Tasks)

Environment variables set for tasks: MX_ARGS, MX_ARG_<N>, MX_PARAM_<NAME>, MX_OUTPUT_<TASK>, vars entries as variables of their own name, and in loops MX_ITEM, MX_INDEX, MX_<AS> and MX_<AXIS>.