Taskfile is a simpler Make

Created: by Pradeep Gowda Updated: Apr 22, 2023 Tagged: golang

Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.

Since it’s written in Go, Task is just a single binary and has no other dependencies, which means you don’t need to mess with any complicated install setups just to use a build tool.

Once installed, you just need to describe your build tasks using a simple YAML schema in a file called Taskfile.yml:

Taskfile.yml
version: '3'

tasks:
  hello:
    cmds:
      - echo 'Hello World from Task!'
    silent: true

And call it by running task hello from your terminal.

Install

brew install go-task  # or directly from source like:
go install github.com/go-task/task/v3/cmd/task@latest

Usage: usage including Env variables, .env. deps, etc

Found via FerretDB’s Taskfile

See also: casey/just: 🤖 Just a command runner (written in Rust)


Update 2023-04-22 I am now using task to automate tasks around building this site. It looks like this:

---
version: 3

env:

vars:
  BENCHTIME: 4s

tasks:
  default:
    deps: [all]

  all:
    desc: "Only build the changes"
    cmds:
      - ./.venv/bin/python3 sitebuild
  full:
    desc: "Do a full build"
    cmds:
      - ./.venv/bin/python3 sitebuild --full
  serve:
    desc: "start a local webserver to serve this website"
    dir: 'output'
    cmds:
      - ../.venv/bin/python3 -m http.server