From 53d5cf36f469f6808371a1a14d1e70dd9711c8e3 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 13 Apr 2026 18:40:11 -0300 Subject: [PATCH] docs: document and add blog post about `go tool task` Closes #2783 --- website/.vitepress/config.ts | 6 +++- website/src/blog/go-tool-task.md | 53 ++++++++++++++++++++++++++++++++ website/src/blog/index.md | 11 ++++++- website/src/docs/installation.md | 22 +++++++++++-- 4 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 website/src/blog/go-tool-task.md diff --git a/website/.vitepress/config.ts b/website/.vitepress/config.ts index 919f0b7f5a..c0ac35c68a 100644 --- a/website/.vitepress/config.ts +++ b/website/.vitepress/config.ts @@ -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' } ] diff --git a/website/src/blog/go-tool-task.md b/website/src/blog/go-tool-task.md new file mode 100644 index 0000000000..fe4e147109 --- /dev/null +++ b/website/src/blog/go-tool-task.md @@ -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` + + + +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 diff --git a/website/src/blog/index.md b/website/src/blog/index.md index c81bc4c8af..4ed71f6804 100644 --- a/website/src/blog/index.md +++ b/website/src/blog/index.md @@ -5,7 +5,16 @@ editLink: false --- + +