Documentation menu

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
Copy

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

Copy
1htmgo template myapp
2cd myapp

The command downloads the starter template, initializes a Git repository, and sets up the app in myapp.

3. Start the development server

htmgo watch
Copy

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
Copy

Run this from your project directory. It builds the executable into ./dist with the production assets embedded.