Task — Fast Cross-Platform Build Tool for Modern Workflows
Task is a task runner and build tool written in Go. It uses simple YAML configuration as a modern, cross-platform alternative to Make — with better syntax, built-in variables, watch mode, and no platform-specific quirks.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 110f3e58-373d-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
What it is
Task is a task runner and build tool written in Go. It uses YAML configuration files as a modern, cross-platform alternative to GNU Make. You define tasks in a Taskfile.yml and run them with task <name>. It supports variables, dependencies between tasks, watch mode, and conditional execution without the platform-specific quirks that make Makefiles painful on Windows.
Task targets developers and DevOps engineers who need a simple build system that works identically on macOS, Linux, and Windows. It ships as a single binary with zero dependencies.
Why it saves time or tokens
Makefiles have implicit rules, tab-sensitive syntax, and platform differences that trip up both humans and AI assistants. Task's YAML syntax is explicit and portable. When asking an AI to generate a build configuration, YAML produces more reliable output than Makefile syntax. The watch mode (task --watch) re-runs tasks on file changes, eliminating manual rebuilds during development.
How to use
- Install Task:
go install github.com/go-task/task/v3/cmd/task@latestor download the binary - Create a
Taskfile.ymlin your project root - Run tasks with
task <name>ortask --watch <name>for file-watching mode
Example
version: '3'
tasks:
build:
desc: Build the application
cmds:
- go build -o bin/app ./cmd/app
sources:
- '**/*.go'
generates:
- bin/app
test:
desc: Run tests
deps: [build]
cmds:
- go test ./...
lint:
desc: Run linter
cmds:
- golangci-lint run
dev:
desc: Build and watch for changes
watch: true
cmds:
- task: build
| Feature | Make | Task |
|---|---|---|
| Config format | Makefile (tabs) | YAML |
| Windows support | Limited | Native |
| Watch mode | External tool | Built-in |
| Dependencies | Implicit rules | Explicit deps |
| Variables | $(VAR) syntax | Go template |
Related on TokRepo
- AI tools for automation — build tools and automation workflows on TokRepo
- AI tools for devops — DevOps tooling and CI/CD helpers
Common pitfalls
- Task does not support Make's implicit pattern rules; every task must be explicitly defined
- The
sourcesandgeneratesfields control caching; omitting them means tasks always re-run even when inputs have not changed - Task version 3 syntax differs from version 2; check the version field in your Taskfile.yml matches your installed Task binary
Preguntas frecuentes
Task uses YAML instead of Makefile syntax, works identically on all operating systems, and includes built-in watch mode. Make is more powerful for complex dependency graphs and has decades of ecosystem support. Task is better for teams that want simple, readable, cross-platform task definitions without learning Make's idiosyncratic syntax.
Yes. You can run tasks in parallel by listing them as dependencies or using the --parallel flag. Task also supports limiting concurrency. Dependencies declared in the deps field run in parallel by default, while commands in the cmds field run sequentially.
Task can define the build, test, and lint commands that your CI pipeline calls, but it does not replace the CI/CD system itself. Use Task to standardize commands locally and in CI. Your GitHub Actions or GitLab CI config calls task build instead of raw shell commands, keeping the logic in one place.
Watch mode monitors files specified in the sources field and re-runs the task when they change. Run task --watch build to rebuild automatically on code changes. This replaces external file-watching tools like nodemon or entr for development workflows.
Yes. Task supports environment variables through the env field on individual tasks, dotenv file loading, and Go template syntax for variable interpolation. You can reference environment variables in commands and conditionals. Task also supports loading .env files automatically.
Referencias (3)
- Task GitHub— Task is a task runner written in Go using YAML configuration
- Task Docs— Task supports watch mode, variables, and cross-platform execution
- YAML Spec— YAML specification for configuration files
Relacionados en TokRepo
Discusión
Activos relacionados
xmake — Cross-Platform Build Utility in Lua
xmake is a lightweight, cross-platform build utility based on Lua that combines a build system, package manager, and project generator for C, C++, Rust, Go, and more.
Avalonia — Cross-Platform .NET UI Framework for Desktop, Mobile & Web
A cross-platform UI framework for .NET that lets you build apps for Windows, macOS, Linux, iOS, Android, and WebAssembly from a single C# and XAML codebase.
fnm — Fast and Simple Node.js Version Manager
fnm (Fast Node Manager) is a blazing-fast Node.js version manager built in Rust. It installs and switches Node.js versions instantly, supports .node-version and .nvmrc files, and is 40x faster than nvm with cross-platform support.
PowerShell — Cross-Platform Automation Shell from Microsoft
PowerShell is a cross-platform task automation solution consisting of a command-line shell, a scripting language, and a configuration management framework that runs on Windows, Linux, and macOS.