Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion website/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ export default defineConfig({
collapsed: false,
items: [
{
text: 'New `if:` Control and Variable Prompt',
text: 'go tool task',
link: '/blog/go-tool-task'
},
{
text: 'New "if:" Control and Variable Prompt',
link: '/blog/if-and-variable-prompt'
}
]
Expand Down
53 changes: 53 additions & 0 deletions website/src/blog/go-tool-task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: go tool task
description: How to use Task using go tool.
author: andreynering
date: 2026-04-14
outline: deep
editLink: false
---

# `go tool task`

<AuthorCard :author="$frontmatter.author" />

Do you know that you can use Task without really needing to install it?

If you work with Go, you probably depend on external binaries like linters,
code generators and... Task.

But asking your coworkers or contributors to install dependencies can be messy.
Everyone is on a different operating system, use a different package manager,
etc. In fact, [Task supports several package managers][install], but even having
to choose how you want to install it can lead to some fatigue.

Well, turns out you can just use `go tool`!

Step one: add Task as a tool to your Go project:

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

The command above will add a line like this to your `go.mod`:

```
tool github.com/go-task/task/v3/cmd/task
```

Step two: prefix `go tool` when calling Task:

```bash
go tool task {arguments...}
```

That's all!

Go will compile the specified Task version on demand when calling `go tool task`.
Don't worry, Go caches the tool, so subsequent calls are faster.

This is useful when running Task on CI, as you don't need to stress about having
to install it. It also means it'll be pinned to a specific Task version (but
Dependabot or Renovate should be able to update it for you).

[install]: https://taskfile.dev/docs/installation
11 changes: 10 additions & 1 deletion website/src/blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ editLink: false
---

<BlogPost
title="New `if:` Control and Variable Prompt"
title="go tool task"
url="/blog/go-tool-task"
date="2026-04-14"
author="andreynering"
description='How to use Task using "go tool".'
:tags="['installation']"
/>

<BlogPost
title='New "if:" Control and Variable Prompt'
url="/blog/if-and-variable-prompt"
date="2026-01-24"
author="vmaerten"
Expand Down
22 changes: 20 additions & 2 deletions website/src/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ examples and configuration.

## Build From Source

### Go Modules

Ensure that you have a supported version of [Go](https://golang.org) properly
installed and setup. You can find the minimum required version of Go in the
[go.mod](https://github.com/go-task/task/blob/main/go.mod#L3) file.
Expand All @@ -346,6 +344,26 @@ 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`.

```bash
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.

```bash
go tool task {arguments...}
```

## Setup completions

Some installation methods will automatically install completions too, but if
Expand Down
Loading