A go tool plugin for the excellent TailwindCSS cli.
I created this tool to make it easier to use TailwindCSS within go projects such as with those using the go templ template engine or html/template etc.
It downloads the TailwindCSS cli standalone binary automatically on first use. Subsequent invocations will use the cached copy. Nodejs is not required.
Go 1.24+. You must upgrade to go 1.24 or newer before using this tool.
Please verify with go version that the version you have is at least 1.24 or it won't work.
To install the latest version of TailwindCSS v4 into an existing go project:
go get -tool github.com/hookenz/gotailwind/v4@latest
Or a specific version of TailwindCSS:
go get -tool github.com/hookenz/gotailwind/v4@v4.3.0
To run it:
go tool gotailwind
GoTailwind is a thin go wrapper around the standalone TailwindCSS cli. It's just a go program that calls the appropriate TailwindCSS binary that is downloaded and cached into a local cache folder.
The GoTailwind version matches the TailwindCSS cli version.
It works wherever go and tailwindcss can run.
In linux the TailwindCSS cli binary is placed into a versioned directory beneath:
~/.cache/gotailwind/
i.e.
~/.cache/gotailwind/v4.1.7/tailwindcss-linux-x64
Which means you can have different projects targetting different versions of TailwindCSS.
Suggestions or improvements are more than welcome.