2022-05-29 14:15:01 -03:00
---
slug: /installation/
sidebar_position: 2
---
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
2020-05-23 13:43:57 -03:00
## Package Managers
2018-09-22 18:44:24 -03:00
2022-06-11 19:17:29 -03:00
### Homebrew
2018-09-22 18:44:24 -03:00
2019-07-21 11:03:20 -03:00
If you're on macOS or Linux and have [Homebrew][homebrew] installed, getting
Task is as simple as running:
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
```
2023-04-16 03:13:29 +08:00
The above Formula is
2023-09-14 21:45:25 -03:00
[maintained by ourselves](https://github.com/go-task/homebrew-tap/blob/main/Formula/go-task.rb).
2022-12-18 22:41:42 -03:00
2023-04-16 03:13:29 +08:00
Recently, Task was also made available
[on the official Homebrew repository](https://formulae.brew.sh/formula/go-task),
2022-12-18 22:41:42 -03:00
so you also have that option if you prefer:
2024-01-25 14:53:13 +00:00
```shell
2022-12-18 22:41:42 -03:00
brew install go-task
```
2024-03-11 13:33:28 +01:00
### pkgx
2023-07-02 19:41:29 +02:00
2024-04-09 12:14:14 +01:00
If you're on macOS or Linux and have [pkgx][pkgx] installed, getting Task is as
2024-01-25 14:53:13 +00:00
simple as running:
2023-07-02 19:41:29 +02:00
2024-01-25 14:53:13 +00:00
```shell
2024-03-11 13:33:28 +01:00
pkgx task
2023-07-02 19:41:29 +02:00
```
2024-03-11 13:33:28 +01:00
or, if you have pkgx integration enabled:
2023-07-02 19:41:29 +02:00
2024-01-25 14:53:13 +00:00
```shell
2023-07-02 19:41:29 +02:00
task
```
2024-01-25 14:53:13 +00:00
2023-07-02 19:41:29 +02:00
This installation method is community owned. After a new release of Task, they
2024-03-11 13:33:28 +01:00
are automatically released by pkgx in a minimum of time.
2023-07-02 19:41:29 +02:00
2022-06-11 19:17:29 -03:00
### Snap
2018-09-22 18:44:24 -03:00
2023-04-16 03:13:29 +08:00
Task is available in [Snapcraft][snapcraft], but keep in mind that your Linux
distribution should allow classic confinement for Snaps to Task work right:
2018-09-22 18:44:24 -03:00
2024-01-25 14:53:13 +00:00
```shell
2020-05-23 13:43:57 -03:00
sudo snap install task --classic
2018-09-22 18:44:24 -03:00
```
2022-06-11 19:17:29 -03:00
### Chocolatey
2022-03-09 15:39:54 -03:00
2023-04-16 03:13:29 +08:00
If you're on Windows and have [Chocolatey][choco] installed, getting Task is as
simple as running:
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
```
2022-03-18 17:41:34 -03:00
This installation method is community owned.
2022-06-11 19:17:29 -03:00
### Scoop
2018-12-06 22:21:03 +09:00
2023-04-16 03:13:29 +08:00
If you're on Windows and have [Scoop][scoop] installed, getting Task is as
simple as running:
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
```
2023-04-16 03:13:29 +08:00
This installation method is community owned. After a new release of Task, it may
take some time until it's available on Scoop.
2018-12-24 14:39:53 -02:00
2022-06-11 19:17:29 -03:00
### AUR
2020-01-25 15:44:55 +03:00
If you're on Arch Linux you can install Task from
2022-09-20 13:05:18 -03:00
[AUR](https://aur.archlinux.org/packages/go-task-bin) using your favorite
2020-01-25 15:44:55 +03:00
package manager such as `yay`, `pacaur` or `yaourt`:
2024-01-25 14:53:13 +00:00
```shell
2022-09-20 13:05:18 -03:00
yay -S go-task-bin
2020-01-25 15:44:55 +03:00
```
2022-09-20 13:05:18 -03:00
Alternatively, there's
[this package](https://aur.archlinux.org/packages/go-task) which installs from
the source code instead of downloading the binary from the
[releases page](https://github.com/go-task/task/releases):
2024-01-25 14:53:13 +00:00
```shell
2022-09-20 13:05:18 -03:00
yay -S go-task
```
2022-09-29 21:27:30 -03:00
This installation method is community owned.
2020-01-25 15:44:55 +03:00
2022-06-11 19:17:29 -03:00
### Fedora
2022-06-07 21:36:45 +03:00
2022-06-11 19:17:29 -03:00
If you're on Fedora Linux you can install Task from the official
2023-04-16 03:13:29 +08:00
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/)
repository using `dnf`:
2022-06-07 21:36:45 +03:00
2024-01-25 14:53:13 +00:00
```shell
2022-06-07 21:36:45 +03:00
sudo dnf install go-task
```
2023-04-16 03:13:29 +08:00
This installation method is community owned. After a new release of Task, it may
take some time until it's available in
[Fedora](https://packages.fedoraproject.org/pkgs/golang-github-task/go-task/).
2022-01-13 00:15:04 +01:00
2022-06-11 19:17:29 -03:00
### Nix
2022-01-13 00:15:04 +01:00
2023-04-16 03:13:29 +08:00
If you're on NixOS or have Nix installed you can install Task from
[nixpkgs](https://github.com/NixOS/nixpkgs):
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
```
2023-04-16 03:13:29 +08:00
This installation method is community owned. After a new release of Task, it may
take some time until it's available in
[nixpkgs](https://github.com/NixOS/nixpkgs).
2022-01-13 00:15:04 +01:00
2022-09-29 21:27:30 -03:00
### npm
You can also use Node and npm to install Task by installing
[this package](https://www.npmjs.com/package/@go-task/cli).
2024-01-25 14:53:13 +00:00
```shell
2022-09-29 21:27:30 -03:00
npm install -g @go-task/cli
```
2023-03-31 08:51:03 +08:00
### Winget
2023-03-30 21:53:06 -03:00
If you are using Windows and installed the
2023-04-16 03:13:29 +08:00
[winget](https://github.com/microsoft/winget-cli) package management tool, you
can install Task from [winget-pkgs](https://github.com/microsoft/winget-pkgs).
2023-03-31 08:51:03 +08:00
2024-01-25 14:53:13 +00:00
```shell
2023-03-30 21:53:06 -03:00
winget install Task.Task
2023-03-31 08:51:03 +08:00
```
2024-05-20 15:08:34 +02:00
### Pacstall
If you are using Debian or Ubuntu, and have [Pacstall](https://pacstall.dev/) installed, you can install Task by running:
```shell
pacstall -I go-task-deb
```
This installation method is community owned. After a new release of Task, it may take some time until it's available in [Pacstall](https://pacstall.dev/packages/go-task-deb).
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 */}
2018-10-07 18:34:03 -03:00
[go]: https://golang.org/
2020-05-23 13:43:57 -03:00
[snapcraft]: https://snapcraft.io/task
2018-09-22 18:44:24 -03:00
[homebrew]: https://brew.sh/
2023-04-15 20:39:35 +01:00
[installscript]: https://github.com/go-task/task/blob/main/install-task.sh
2018-09-22 18:44:24 -03:00
[releases]: https://github.com/go-task/task/releases
[godownloader]: https://github.com/goreleaser/godownloader
2022-03-09 15:39:54 -03:00
[choco]: https://chocolatey.org/
2018-12-06 22:21:03 +09:00
[scoop]: https://scoop.sh/
2024-04-09 12:14:14 +01:00
[pkgx]: https://pkgx.sh/
2024-03-19 19:48:46 +00:00
{/* prettier-ignore-end */}