task/website/src/next/docs/installation.md

17 KiB
Raw Blame History

title description section docType outline pageClass
Installation Installation methods for Task Getting Started guide deep installation-page

Installation

Choose a package manager for your system, or install Task from a binary.

Binaries & CI Verify installation Shell completions

Official packages

Maintained by the Task team and kept up-to-date.

Homebrew

Tap source Homebrew package Formula source

brew install go-task/tap/go-task

Or use the Homebrew core formula:

brew install go-task

dnf

View package

Set up the repository:

curl -1sLf 'https://dl.cloudsmith.io/public/task/task/setup.rpm.sh' | sudo -E bash

Install Task:

dnf install task

apt

View package

Set up the repository:

curl -1sLf 'https://dl.cloudsmith.io/public/task/task/setup.deb.sh' | sudo -E bash

Install Task:

apt install task

apk

View package

Set up the repository:

curl -1sLf 'https://dl.cloudsmith.io/public/task/task/setup.alpine.sh' | sudo -E bash

Install Task:

apk add task

Snap

Source

sudo snap install task --classic

Requires a Linux distribution with classic confinement support.

npm

View package Source

npm install -g @go-task/cli

Task is also available as a project dependency.

WinGet

Source

winget install Task.Task

Available through the WinGet community repository.

Package repository hosting for deb/rpm/apk is graciously provided by Cloudsmith.

Community packages

Maintained by the community, outside the Task team's control. These packages may lag behind the latest release.

Mise

View package

mise use -g task

For a project-local installation, use mise use task instead. This adds Task to your project's mise.toml.

Macports

View package Source

port install go-task

pip

View package Source

pip install go-task-bin

Chocolatey

View package Source

choco install go-task

Scoop

Source

scoop install task

Arch (pacman)

View package Source

pacman -S go-task

Fedora (dnf)

View package Source

dnf install go-task

FreeBSD (Ports)

View package Source

pkg install task

Nix

Source

nix-env -iA nixpkgs.go-task

pacstall

View package Source

pacstall -I go-task-deb

pkgx

View package Source

pkgx task

or, if you have pkgx integration enabled:

task

Binaries & CI

Install Task without a package manager: download a binary, use the install script, or add the setup action to your GitHub workflow.

Download a binary

  1. Open the GitHub releases and download the archive for your operating system and architecture.
  2. Extract task (task.exe on Windows).
  3. Move the executable to a directory on your PATH.

Each release also includes DEB, RPM and APK packages, plus task_checksums.txt with SHA-256 checksums for the release files.

Install with a script

Use the install script for a shell-based installation, including CI environments. It downloads a prebuilt binary and verifies its checksum; no Go installation is needed.

By default, the script installs the latest release into ./bin, relative to your current directory. Choose a different directory or pin a release:

::: code-group

sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d v3.42.1
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin v3.42.1

:::

When combining options, keep the release tag last.

::: tip Make Task available in your shell

Add the installation directory to your PATH to run task from anywhere. With the default location, you can also run ./bin/task directly.

On Linux, ~/.local/bin and ~/bin are common per-user locations; /usr/local/bin is a system-wide location and may require elevated permissions. Do not assume these directories are already on your PATH, especially on macOS and Windows.

:::

GitHub Actions

Add the official setup action to your job's steps before running Task:

- name: Install Task
  uses: go-task/setup-task@v2

- name: Verify Task
  run: task --version

Use the action's version input to pin a Task release. See the action documentation for examples and configuration.

Build from source

Ensure that you have a supported version of Go properly installed and setup. You can find the minimum required version of Go in the go.mod file.

You can then install the latest release globally by running:

go install github.com/go-task/task/v3/cmd/task@latest

Or you can install into another directory:

env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest

::: tip

For CI environments we recommend using the install script instead, which is faster and more stable, since it'll just download the latest released binary.

:::

Go Tool

If you're working in a Go project, a nice possibility is using go tool. go tool makes it easy to run Task without needing to install the binary manually. This works well on CI.

To do that, just run the following to add Task as a tool in your Go project. Task will be added to your go.mod.

go get -tool github.com/go-task/task/v3/cmd/task@latest

Then, prefix go tool when calling Task like below. Go will compile Task on demand before calling it.

go tool task {arguments...}

Verify installation

After installing, open a terminal and check that Task is available:

task --version

If you installed Task with go tool, run go tool task --version instead.

You're ready to create your first Taskfile. You can also enable shell completions below.

Shell completions

Some installation methods will automatically install completions too, but if this isn't working for you or your chosen method doesn't include them, you can run task --completion <shell> to output a completion script for any supported shell.

Every shell shares a single source of truth: the script is a thin wrapper that asks the task binary itself what to suggest, so Bash, Zsh, Fish, Nushell and PowerShell all offer the same task names, aliases, flags, flag values and requires vars.

There are a couple of ways these completions can be added to your shell config:

This method loads the completion script from the currently installed version of task every time you create a new shell. This ensures that your completions are always up-to-date. If your executable isn’t named task, set the TASK_EXE environment variable before running eval.

::: code-group

# ~/.bashrc

# export TASK_EXE='go-task' if needed
eval "$(task --completion bash)"
# ~/.zshrc

# export TASK_EXE='go-task' if needed
eval "$(task --completion zsh)"
# ~/.config/fish/config.fish

# export TASK_EXE='go-task' if needed
task --completion fish | source
# $PROFILE\Microsoft.PowerShell_profile.ps1
Invoke-Expression  (&task --completion powershell | Out-String)
# ~/.config/nushell/config.nu
#
# Nushell cannot source a script from stdin, so the script is saved where
# Nushell auto-loads it at startup. Autoload directories are read after
# config.nu, so the completions become available in the next shell.
mkdir ($nu.data-dir | path join "vendor/autoload")
task --completion nu | save --force ($nu.data-dir | path join "vendor/autoload/task-completions.nu")

:::

Option 2. Copy the script to your shell's completions directory

This method requires you to manually update the completions whenever Task is updated. However, it is useful if you want to modify the completions yourself.

::: code-group

task --completion bash > /etc/bash_completion.d/task
task --completion zsh  > /usr/local/share/zsh/site-functions/_task
task --completion fish > ~/.config/fish/completions/task.fish
task --completion nu | save --force ($nu.data-dir | path join "vendor/autoload/task-completions.nu")

:::

Zsh customization

The Zsh completion supports the standard verbose zstyle to control whether task descriptions are shown. By default, descriptions are displayed. To show only task names without descriptions, add this to your ~/.zshrc (after the completion is loaded):

zstyle ':completion:*:*:task:*' verbose false

By default, task aliases are also offered as completions. To complete only the canonical task names, add the show-aliases zstyle:

zstyle ':completion:*:*:task:*' show-aliases false

Nushell caveats

Nushell cannot source a script from stdin, so both options above write the script to an autoload directory. Option 1 rewrites it at every startup, which keeps it in sync with the installed version of Task, and the refreshed completions are picked up by the next shell. With option 2, re-run the command after upgrading Task.

Nushell shares a single external completer between every command, so the script chains to the one already configured — carapace and friends keep working. Load it from an autoload directory as shown above rather than from config.nu, so that your own completer is the one being chained to. If you would rather wire it yourself, the script also exposes a task-external-completer command:

$env.config.completions.external.completer = {|spans|
    match ($spans | first) {
        task => (task-external-completer $spans)
        _ => (do $my_other_completer $spans)
    }
}

Two engine directives behave differently under Nushell by design: it never appends a space after an external completion (so NoSpace is a no-op) and never re-sorts the results (so KeepOrder is always honoured).