A modern Go starter template that unifies a Cobra CLI, Gin-powered REST API, and Templ + HTMX + TailwindCSS (GoTTH) web frontend — all served together with a single command.
- Cobra CLI – easy command creation and management.
- Gin – high-performance HTTP web framework.
- Swagger (gin-swagger) – live, auto-generated API documentation.
- Templ – type-safe HTML templating in Go.
- HTMX – minimal-JS interactivity using server responses.
- TailwindCSS v4 – modern utility-first styling.
- Unified Serve Command – run API + web UI with
cobra-gin-starter serve.
Clone the project
git clone https://github.com/6missedcalls/cobra-gin-starter.gitGo to the project directory
cd cobra-gin-starterInstall dependencies
go mod tidy
bun installGenerate Templ Components & Build TailwindCSS
templ generate
bun run build:cssStart the server (development)
go run main.go serveStart the server (production)
./cobra-gin-starter serveClient: HTMX, Templ, TailwindCSS v4
Server: Go, Gin, gin-swagger
CLI: Cobra
Contributions are always welcome!
See docs/contributing.md for ways to get started,