Task
A cross-platform task runner that defines project commands and dependencies in a YAML Taskfile.
Why consider Task?
A fast, cross-platform build tool and task runner that provides a modern, YAML-based alternative to Make.
Learn Task by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Task is a fast, cross-platform build tool and task runner designed to modernize project automation, drawing inspiration from Make. Software projects historically relied on Makefile configurations, which are deeply tied to Unix environments and require strict formatting rules. Task instead provides a cleaner, structured approach using a well-known configuration format. For an overview of the project, see the canonical repository.
YAML-based Task Definitions
Unlike Makefiles, Task uses standard YAML syntax to define tasks, variables, and dependencies. This formatting choice makes the automation logic easier to read, parse, and integrate into modern CI/CD toolchains. Instead of wrestling with Make's tab-versus-space indentation rules or platform-specific shells, developers can maintain predictable, standardized build files.
A major advantage for diverse engineering teams is that Task bundles a native Go shell interpreter. This means bash-like commands execute reliably on Windows without requiring WSL or a standalone shell installation. Developers can write shell logic inside their Taskfile.yml once and trust that it will behave identically on Linux, macOS, and Windows environments.
To support complex configurations, Task provides built-in support for loading environment variables directly from dotenv files, eliminating the need to source them manually before executing a command. You can define multiple .env layers, allowing localized development overrides to take precedence over base defaults without creating complicated wrapper scripts.
Getting Started and Initialization
You can install the executable through various package managers based on your operating system, including Homebrew, APT, and Winget. Once installed, the tool provides a built-in initialization flag to scaffold a default configuration file in the current directory.
Run the following command to generate the starting file, as detailed in the Getting Started documentation:
task --initThis creates a Taskfile.yml file populated with a basic structure and variables. The starting layout looks like this:
version: '3'vars: GREETING: Hello, World!tasks: default: desc: Print a greeting message cmds: - echo "{{.GREETING}}" silent: trueExecuting Commands
When you execute Task without any arguments, it automatically triggers the task named default. If you want to trigger it explicitly, you can pass the name of the task directly to the executable:
task defaultTask searches the current working directory for the Taskfile.yml and runs the command sequence defined under the default block. Because the silent: true attribute is set, the CLI suppresses its default behavior of echoing the executed shell command to standard output, returning only the final printed message to the terminal.
If a file is not found in the immediate directory, the runner will automatically traverse up the directory tree until it discovers one. This mimics git behavior and allows you to execute project-wide commands from deeply nested subdirectories.
For deeper integrations and to see how to incorporate advanced .env structures into complex project dependencies, consult the Task guide. For an exhaustive list of package managers and system-specific dependencies, visit the Task installation page.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.