Documentation menu
Getting Started
Core Concepts
Control
Interactivity
Pushing Data
HTMX Extensions
Miscellaneous
Configuration
Quick Start
Prerequisites
The htmx 4 documentation covers the request and swap concepts used in this guide.
1. Install htmgo
go install github.com/franchb/htmgo/cli/htmgo/v2@latest
go install github.com/franchb/htmgo/cli/htmgo/v2@latestCopy
Add the directory where Go installs binaries to your PATH. This is GOBIN if set, or the bin directory under GOPATH.
2. Create a project
htmgo template myapp
cd myapp
Copy
1htmgo template myapp
2cd myappThe command downloads the starter template, initializes a Git repository, and sets up the app in myapp.
3. Start the development server
htmgo watch
htmgo watchCopy
Open http://localhost:3000 to view the starter app. Source changes trigger a rebuild and browser reload. Use htmgo run to start the server without watching files.
4. Build for production
htmgo build
htmgo buildCopy
Run this from your project directory. It builds the executable into ./dist with the production assets embedded.