Penguin-KarChunTKarChunT

Overriding Task Name

Learn how to override task names in Taskfile to customize task execution and improve organization.

You can override the task name printed on the summary by using the label: field in your Taskfile. This is useful when you want to customize how tasks are displayed in the output, especially when using variables.

Taskfile.yaml
version: '3'
tasks:
  display:
    internal: true
    label: 'display-{{.MESSAGE}}'
    cmds:
      - echo "{{.MESSAGE}}"
  test:
    cmds:
      - task: display
        vars:
          MESSAGE: hello
      - task: display
        vars:
          MESSAGE: world
Demo and Output
ubuntu@touted-mite:~$ task test 
task: [display-hello] echo "hello"
hello
task: [display-world] echo "world"
world