2022-05-29 14:15:01 -03:00
---
slug: /installation/
sidebar_position: 2
2025-01-02 18:20:29 +00:00
toc_max_heading_level: 4
2022-05-29 14:15:01 -03:00
---
2024-09-02 20:21:53 +01:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2018-09-22 18:44:24 -03:00
# Installation
2020-05-23 13:43:57 -03:00
Task offers many installation methods. Check out the available methods below.
2018-09-22 18:44:24 -03:00
2025-01-02 18:20:29 +00:00
:::info
Some of the methods below are marked as ![Community][community]. This means they
are not maintained by the Task team and may not be up-to-date.
:::
2020-05-23 13:43:57 -03:00
## Package Managers
2018-09-22 18:44:24 -03:00
2025-01-02 18:20:29 +00:00
### [Homebrew][homebrew] ![][macos] ![][linux] \{#homebrew}
2018-09-22 18:44:24 -03:00
2025-01-02 18:20:29 +00:00
Task is available via our official Homebrew tap [[source](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb)]:
2018-09-22 18:44:24 -03:00
2024-01-25 14:53:13 +00:00
```shell
2018-09-22 18:44:24 -03:00
brew install go-task/tap/go-task
```
2025-01-02 18:20:29 +00:00
Alternatively it can be installed from the official Homebrew
repository [[package](https://formulae.brew.sh/formula/go-task)]
[[source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/go-task.rb)] by running:
2022-12-18 22:41:42 -03:00
2024-01-25 14:53:13 +00:00
```shell
2022-12-18 22:41:42 -03:00
brew install go-task
```
2025-01-02 18:20:29 +00:00
### [Snap][snapcraft] ![][macos] ![][linux] \{#snap}
2023-07-02 19:41:29 +02:00
2025-01-02 18:20:29 +00:00
Task is available on [Snapcraft][snapcraft] [[source](https://github.com/go-task/snap/blob/main/snap/snapcraft.yaml)], but keep in mind that your Linux
distribution should allow classic confinement for Snaps to Task work correctly:
2023-07-02 19:41:29 +02:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
sudo snap install task --classic
2023-07-02 19:41:29 +02:00
```
2025-01-02 18:20:29 +00:00
### [npm][npm] ![][macos] ![][linux] ![][windows] \{#npm}
Npm can be used as cross-platform way to install Task globally or as a
dependency of your project
[[package](https://www.npmjs.com/package/@go-task/cli)] [[source](https://github.com/go-task/task/blob/main/package.json)]:
2023-07-02 19:41:29 +02:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
npm install -g @go-task/cli
2023-07-02 19:41:29 +02:00
```
2024-01-25 14:53:13 +00:00
2025-01-02 18:20:29 +00:00
### [pip][pip] ![][macos] ![][linux] ![][windows] ![][community] \{#pip}
Like npm, pip can be used as a cross-platform way to install Task
[[package](https://pypi.org/project/go-task-bin)] [[source](https://github.com/Bing-su/pip-binary-factory/tree/main/task)]:
```shell
pip install go-task-bin
```
2023-07-02 19:41:29 +02:00
2025-01-02 18:20:29 +00:00
### [WinGet][winget] ![][windows] \{#winget}
2018-09-22 18:44:24 -03:00
2025-01-02 18:20:29 +00:00
Task is available via the [community repository](https://github.com/microsoft/winget-pkgs) [[source](https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/Task/Task)]:
2018-09-22 18:44:24 -03:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
winget install Task.Task
2018-09-22 18:44:24 -03:00
```
2025-01-02 18:20:29 +00:00
### [Chocolatey][choco] ![][windows] ![][community] \{#chocolatey}
2022-03-09 15:39:54 -03:00
2025-01-02 18:20:29 +00:00
[[package](https://community.chocolatey.org/packages/go-task)] [[source](https://github.com/Starz0r/ChocolateyPackagingScripts/blob/master/src/go-task_gh_build.py)]
2022-03-09 15:39:54 -03:00
2024-01-25 14:53:13 +00:00
```shell
2022-03-09 15:39:54 -03:00
choco install go-task
```
2025-01-02 18:20:29 +00:00
### [Scoop][scoop] ![][windows] ![][community] \{#scoop}
2018-12-06 22:21:03 +09:00
2025-01-02 18:20:29 +00:00
[[source](https://github.com/ScoopInstaller/Main/blob/master/bucket/task.json)]
2018-12-06 22:21:03 +09:00
2024-01-25 14:53:13 +00:00
```shell
2018-12-06 22:21:03 +09:00
scoop install task
```
2025-01-02 18:20:29 +00:00
### Arch ([pacman][pacman]) ![][arch] ![][community] \{#arch}
2018-12-24 14:39:53 -02:00
2025-01-02 18:20:29 +00:00
[[package](https://archlinux.org/packages/extra/x86_64/go-task/)] [[source](https://gitlab.archlinux.org/archlinux/packaging/packages/go-task)]
2020-01-25 15:44:55 +03:00
2024-01-25 14:53:13 +00:00
```shell
2024-12-29 14:13:14 +00:00
pacman -S go-task
2022-09-20 13:05:18 -03:00
```
2025-01-02 18:20:29 +00:00
### Fedora ([dnf][dnf]) ![][fedora] ![][community] \{#fedora}
2022-06-07 21:36:45 +03:00
2025-01-02 18:20:29 +00:00
[[package](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)] [[source](https://src.fedoraproject.org/rpms/golang-github-task)]
2022-06-07 21:36:45 +03:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
dnf install go-task
2022-06-07 21:36:45 +03:00
```
2025-01-02 18:20:29 +00:00
### NixOS ([nix][nix]) ![][nixos] ![][linux] ![][community] \{#nix}
2022-01-13 00:15:04 +01:00
2025-01-02 18:20:29 +00:00
[[source](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/go/go-task/package.nix)]
2022-01-13 00:15:04 +01:00
2024-01-25 14:53:13 +00:00
```shell
2022-01-13 00:15:04 +01:00
nix-env -iA nixpkgs.go-task
```
2025-01-02 18:20:29 +00:00
### [pacstall][pacstall] ![][debian] ![][ubuntu] ![][community] \{#pacstall}
2022-09-29 21:27:30 -03:00
2025-01-02 18:20:29 +00:00
[[package](https://pacstall.dev/packages/go-task-deb)] [[source](https://github.com/pacstall/pacstall-programs/blob/master/packages/go-task-deb/go-task-deb.pacscript)]
2022-09-29 21:27:30 -03:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
pacstall -I go-task-deb
2022-09-29 21:27:30 -03:00
```
2025-01-02 18:20:29 +00:00
### [pkgx][pkgx] ![][macos] ![][linux] ![][community] \{#pkgx}
2023-03-31 08:51:03 +08:00
2025-01-02 18:20:29 +00:00
[[package](https://pkgx.dev/pkgs/taskfile.dev)] [[source](https://github.com/pkgxdev/pantry/blob/main/projects/taskfile.dev/package.yml)]
2023-03-31 08:51:03 +08:00
2024-01-25 14:53:13 +00:00
```shell
2025-01-02 18:20:29 +00:00
pkgx task
2023-03-31 08:51:03 +08:00
```
2025-01-02 18:20:29 +00:00
or, if you have pkgx integration enabled:
2024-05-20 15:08:34 +02:00
```shell
2025-01-02 18:20:29 +00:00
task
2024-05-20 15:08:34 +02:00
```
2020-05-23 13:43:57 -03:00
## Get The Binary
2018-11-10 20:10:44 -02:00
2022-06-11 19:17:29 -03:00
### Binary
2018-11-10 20:10:44 -02:00
2023-04-16 03:13:29 +08:00
You can download the binary from the [releases page on GitHub][releases] and add
to your `$PATH`.
2018-11-10 20:10:44 -02:00
2020-05-23 13:43:57 -03:00
DEB and RPM packages are also available.
2018-11-10 20:10:44 -02:00
2020-05-23 13:43:57 -03:00
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
2018-11-10 20:10:44 -02:00
2022-06-11 19:17:29 -03:00
### Install Script
2018-09-22 18:44:24 -03:00
2021-04-04 17:31:41 +01:00
We also have an [install script][installscript] which is very useful in
scenarios like CI. Many thanks to [GoDownloader][godownloader] for enabling the
easy generation of this script.
2018-09-22 18:44:24 -03:00
2022-07-16 22:54:47 -03:00
By default, it installs on the `./bin` directory relative to the working
directory:
2024-01-25 14:53:13 +00:00
```shell
2020-11-17 10:02:06 +02:00
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
2022-07-16 22:54:47 -03:00
```
2020-10-16 18:12:26 -05:00
2022-07-16 22:54:47 -03:00
It is possible to override the installation directory with the `-b` parameter.
On Linux, common choices are `~/.local/bin` and `~/bin` to install for the
current user or `/usr/local/bin` to install for all users:
2020-10-07 14:57:25 -05:00
2024-01-25 14:53:13 +00:00
```shell
2022-07-16 22:54:47 -03:00
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
2018-09-22 18:44:24 -03:00
```
2022-07-16 22:54:47 -03:00
:::caution
2022-05-29 14:15:01 -03:00
2022-07-16 22:54:47 -03:00
On macOS and Windows, `~/.local/bin` and `~/bin` are not added to `$PATH` by
default.
2018-09-22 18:44:24 -03:00
2022-05-29 14:15:01 -03:00
:::
2024-05-20 15:01:59 +02:00
By default, it installs the latest version available.
You can also specify a tag (available in [releases](https://github.com/go-task/task/releases))
to install a specific version:
```shell
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d v3.36.0
```
2022-06-11 19:17:29 -03:00
### GitHub Actions
2019-10-24 23:55:11 -03:00
If you want to install Task in GitHub Actions you can try using
2023-04-16 03:13:29 +08:00
[this action](https://github.com/arduino/setup-task) by the Arduino team:
2019-10-24 23:55:11 -03:00
```yaml
- name: Install Task
2024-07-05 13:38:44 +02:00
uses: arduino/setup-task@v2
2023-03-30 21:33:17 -03:00
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
2019-10-24 23:55:11 -03:00
```
This installation method is community owned.
2020-05-23 13:43:57 -03:00
## Build From Source
2022-06-11 19:17:29 -03:00
### Go Modules
2020-05-23 13:43:57 -03:00
2023-04-16 03:13:29 +08:00
Ensure that you have a supported version of [Go][go] properly installed and
setup. You can find the minimum required version of Go in the
2023-04-15 20:39:35 +01:00
[go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
2020-05-23 13:43:57 -03:00
2023-03-09 19:07:05 +00:00
You can then install the latest release globally by running:
2020-05-23 13:43:57 -03:00
2024-01-25 14:53:13 +00:00
```shell
2021-04-04 17:30:42 +01:00
go install github.com/go-task/task/v3/cmd/task@latest
2020-12-26 15:06:39 -03:00
```
Or you can install into another directory:
2020-05-23 13:43:57 -03:00
2024-01-25 14:53:13 +00:00
```shell
2021-04-04 17:30:42 +01:00
env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest
```
2020-05-23 13:43:57 -03:00
2022-05-29 14:15:01 -03:00
:::tip
2023-03-30 22:05:20 -03:00
For CI environments we recommend using the [install script](#install-script)
2022-05-29 14:15:01 -03:00
instead, which is faster and more stable, since it'll just download the latest
released binary.
2020-05-23 13:43:57 -03:00
2022-05-29 14:15:01 -03:00
:::
2020-05-23 13:43:57 -03:00
2022-10-25 20:54:17 +02:00
## Setup completions
2024-09-02 20:21:53 +01:00
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. There are a couple of ways these completions can be added to your shell
config:
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
### Option 1. Load the completions in your shell's startup config (Recommended)
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
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.
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<Tabs values={[ {label: 'bash', value: '1'}, {label: 'zsh', value: '2'},
{label: 'fish', value: '3'},
{label: 'powershell', value: '4'}
]}>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="1">
```shell title="~/.bashrc"
eval "$(task --completion bash)"
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="2">
```shell title="~/.zshrc"
eval "$(task --completion zsh)"
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="3">
```shell title="~/.config/fish/config.fish"
task --completion fish | source
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="4">
```powershell title="$PROFILE\Microsoft.PowerShell_profile.ps1"
2024-09-18 16:46:02 +02:00
Invoke-Expression (&task --completion powershell | Out-String)
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem></Tabs>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
### Option 2. Copy the script to your shell's completions directory
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
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.
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<Tabs
values={[
{label: 'bash', value: '1'},
{label: 'zsh', value: '2'},
{label: 'fish', value: '3'}
]}>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="1">
2022-10-25 20:54:17 +02:00
```shell
2024-09-02 20:21:53 +01:00
task --completion bash > /etc/bash_completion.d/task
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="2">
```shell
task --completion zsh > /usr/local/share/zsh/site-functions/_task
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem>
2022-10-25 20:54:17 +02:00
2024-09-02 20:21:53 +01:00
<TabItem value="3">
2022-10-25 20:54:17 +02:00
```shell
2024-09-02 20:21:53 +01:00
task --completion fish > ~/.config/fish/completions/task.fish
2022-10-25 20:54:17 +02:00
```
2024-09-02 20:21:53 +01:00
</TabItem></Tabs>
2022-10-25 20:54:17 +02:00
2024-03-19 19:48:46 +00:00
{/* prettier-ignore-start */}
2025-01-02 18:20:29 +00:00
[homebrew]: https://brew.sh
2020-05-23 13:43:57 -03:00
[snapcraft]: https://snapcraft.io/task
2025-01-02 18:20:29 +00:00
[winget]: https://github.com/microsoft/winget-cli
[choco]: https://chocolatey.org
[scoop]: https://scoop.sh
[pacman]: https://wiki.archlinux.org/title/Pacman
[dnf]: https://docs.fedoraproject.org/en-US/quick-docs/dnf
[nix]: https://nixos.org
[npm]: https://www.npmjs.com
[pip]: https://pip.pypa.io
[mise]: https://mise.jdx.dev
[aqua]: https://aquaproj.github.io
[pacstall]: https://github.com/pacstall/pacstall
[pkgx]: https://pkgx.sh
[go]: https://golang.org
2018-09-22 18:44:24 -03:00
[godownloader]: https://github.com/goreleaser/godownloader
2025-01-02 18:20:29 +00:00
[releases]: https://github.com/go-task/task/releases
[installscript]: https://github.com/go-task/task/blob/main/install-task.sh
[community]: https://img.shields.io/badge/Community%20Owned-orange
[windows]: https://custom-icon-badges.demolab.com/badge/Windows-0078D6?logo=windows11&logoColor=white
[macos]: https://img.shields.io/badge/MacOS-000000?logo=apple&logoColor=F0F0F0
[linux]: https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black
[arch]: https://img.shields.io/badge/Arch%20Linux-1793D1?logo=arch-linux&logoColor=fff
[fedora]: https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff
[nixos]: https://img.shields.io/badge/NixOS-5277C3?logo=nixos&logoColor=fff
[debian]: https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff
[ubuntu]: https://img.shields.io/badge/Ubuntu-E95420?logo=ubuntu&logoColor=fff
2024-03-19 19:48:46 +00:00
{/* prettier-ignore-end */}