File match Taskfile.yaml Taskfile.dist.yaml Taskfile.yml Taskfile.dist.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/taskfile-config/latest.json
Source https://taskfile.dev/schema.json

Validate with Lintel

npx @lintel/lintel check

Schema for Taskfile files.

All of

1. object object
version string | number required

Specify the Taskfile format that this file conforms to.

Defines how the STDOUT and STDERR are printed when running tasks in parallel. The interleaved output prints lines in real time (default). The group output will print the entire output of a command once, after it finishes, so you won't have live feedback for commands that take a long time to run. The prefix output will prefix every line printed by a command with [task-name] as the prefix, but you can customize the prefix for a command with the prefix: attribute.

method string

Defines which method is used to check the task is up-to-date. (default: checksum)

Default: "checksum"
Values: "none" "checksum" "timestamp"
includes object

Imports tasks from the specified taskfiles. The tasks described in the given Taskfiles will be available with the informed namespace.

vars object
env vars
tasks object
silent boolean

Default 'silent' options for this Taskfile. If false, can be overridden with true in a task by task basis.

set set[]

Enables POSIX shell options for all commands in the Taskfile. See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html

shopt shopt[]

Enables Bash shell options for all commands in the Taskfile. See https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html

dotenv string[]

A list of .env file paths to be parsed.

run string
Values: "always" "once" "when_changed"
interval string

Sets a different watch interval when using --watch, the default being 100 milliseconds. This string should be a valid Go duration: https://pkg.go.dev/time#ParseDuration.

pattern=^[0-9]+(?:m|s|ms)$

Definitions

env object
platforms string[]
tasks object
task object
cmds cmd[]
label string

Overrides the name of the task in the output when a task is run. Supports variables.

desc string

A short description of the task. This is displayed when calling task --list.

prompt string | string[]

One or more prompts that will be presented before a task is run. Declining will cancel running the current and any subsequent tasks.

summary string

A longer description of the task. This is displayed when calling task --summary [task].

aliases string[]

A list of alternative names by which the task can be called.

sources glob[]

A list of sources to check before running this task. Relevant for checksum and timestamp methods. Can be file paths or star globs.

generates glob[]

A list of files meant to be generated by this task. Relevant for timestamp method. Can be file paths or star globs.

status string[]

A list of commands to check if this task should run. The task is skipped otherwise. This overrides method, sources and generates.

preconditions precondition[]

A list of commands to check if this task should run. If a condition is not met, the task will error.

dir string

The directory in which this task should run. Defaults to the current working directory.

set set[]

Enables POSIX shell options for all of a task's commands. See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html

shopt shopt[]

Enables Bash shell options for all of a task's commands. See https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html

vars object
env vars
dotenv string[]

A list of .env file paths to be parsed.

silent boolean

Hides task name and command from output. The command's output will still be redirected to STDOUT and STDERR. When combined with the --list flag, task descriptions will be hidden.

Default: false
interactive boolean

Tells task that the command is interactive.

Default: false
internal boolean

Stops a task from being callable on the command line. It will also be omitted from the output when used with --list.

Default: false
method string

Defines which method is used to check the task is up-to-date. timestamp will compare the timestamp of the sources and generates files. checksum will check the checksum (You probably want to ignore the .task folder in your .gitignore file). none skips any validation and always run the task.

Default: "none"
Values: "none" "checksum" "timestamp"
prefix string

Defines a string to prefix the output of tasks running in parallel. Only used when the output mode is prefixed.

ignore_error boolean

Continue execution if errors happen while executing commands.

run string
Values: "always" "once" "when_changed"
platforms string[]
if string

A shell command to evaluate. If the exit code is non-zero, the task is skipped.

requires object
1 nested properties
vars string | object[]

List of variables that must be defined for the task to run

watch boolean

Configures a task to run in watch mode automatically.

Default: false
failfast boolean

When running tasks in parallel, stop all tasks if one fails.

Default: false
cmds cmd[]
cmd string | cmd_call | task_call | defer_task_call | defer_cmd_call | for_cmd_call | for_task_call
deps string | task_call | for_deps_call[]
set string
shopt string
vars object
var_subkey object
sh string

The value will be treated as a command and the output assigned to the variable

ref string

The value will be used to lookup the value of another variable which will then be assigned to this variable

map object

The value will be treated as a literal map type and stored in the variable

task_call object
task string required

Name of the task to run

vars object
silent boolean

Hides task name and command from output. The command's output will still be redirected to STDOUT and STDERR.

if string

A shell command to evaluate. If the exit code is non-zero, the command is skipped.

cmd_call object
cmd string required

Command to run

silent boolean

Silent mode disables echoing of command before Task runs it

set set[]

Enables POSIX shell options for this command. See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html

shopt shopt[]

Enables Bash shell options for this command. See https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html

ignore_error boolean

Prevent command from aborting the execution of task even after receiving a status code of 1

platforms string[]
if string

A shell command to evaluate. If the exit code is non-zero, the command is skipped.

defer_task_call object
defer task_call required

Run a command when the task completes. This command will run even when the task fails

defer_cmd_call object
defer string required

Name of the command to defer

silent boolean

Hides task name and command from output. The command's output will still be redirected to STDOUT and STDERR.

for_cmd_call object
cmd string required

Command to run

silent boolean

Silent mode disables echoing of command before Task runs it

platforms string[]
for_task_call object
task string required

Task to run

vars object
silent boolean

Silent mode disables echoing of command before Task runs it

platforms string[]
if string

A shell command to evaluate. If the exit code is non-zero, the command is skipped.

for_deps_call object
task string required

Task to run

silent boolean

Silent mode disables echoing of command before Task runs it

vars object
for for_list | for_attribute | for_var | for_matrix
for_list string | number[]

A list of values to iterate over

for_attribute string

The task attribute to iterate over

for_var object

Which variables to iterate over. The variable will be split using any whitespace character by default. This can be changed by using the split attribute.

var string required

Name of the variable to iterate over

split string

String to split the variable on

as string

What the loop variable should be named

Default: "ITEM"
for_matrix object

A matrix of values to iterate over

precondition string | precondition_obj
precondition_obj object
sh string

Command to run. If that command returns 1, the condition will fail

msg string

Failure message to display when the condition fails

glob string | glob_obj
glob_obj object
exclude string

File or glob pattern to exclude from the list

run string
outputString string
outputObject object
group object
3 nested properties
begin string
end string
error_only boolean

Swallows command output on zero exit code

Default: false
requires_obj object
vars string | object[]

List of variables that must be defined for the task to run