Skip to content

Guide ​

Use the guide to learn a feature or solve a specific problem. If you are new to Task, start with the Quick Start. For accepted keys, flags and functions, use the Taskfile Schema, CLI and Templating references.

Writing and running tasks ​

  • Defining tasks: command lists, descriptions, aliases and display labels.
  • Running tasks: choosing a Taskfile, running from other directories, previewing commands and using interactive applications.

Variables and arguments ​

  • Variables: declaring values, computing them with shell commands, preserving types and understanding resolution order.
  • Command-line arguments: assigning variables, forwarding arguments with -- and capturing values from task names.
  • Validation and prompts: requiring inputs, restricting allowed values and asking for missing values.
  • Secret variables: loading sensitive values and masking them in Task's command logs.

Task execution ​

  • Dependencies and task calls: running tasks concurrently or in sequence, limiting concurrency and controlling repeated calls.
  • Loops: repeating commands or task calls over values, files and matrices.
  • Conditional execution: skipping optional work with if, enforcing requirements with preconditions and asking for confirmation.
  • Errors and cleanup: continuing after selected failures and running cleanup with defer.
  • Up-to-date checks: skipping unchanged builds, checking for missing outputs and combining file checks with custom conditions.
  • Watch mode: rerunning tasks when source files change.

Environment and output ​

  • Environment variables: setting the environment for commands and loading .env files.
  • Platforms and shells: selecting platform-specific commands, understanding shell context and setting shell options.
  • Output and logging: streaming, grouping and prefixing output, hiding command echoes and displaying CI annotations.

Including Taskfiles ​

  • Including Taskfiles: sharing tasks with namespaces, configuring includes and passing variables to them.
  • Remote Taskfiles: loading Taskfiles over HTTP or Git and managing trust, checksums and cached copies.