Guide / 01
Installation
Prepare your environment for cooking high-performance Go applications.
Prerequisites
- Go 1.22+ — For
net/http.ServeMuxsupport with HTTP verbs. - TinyGo 0.31+ — (Optional) To compile
<goscript client>blocks into WebAssembly. Without TinyGo, the server works perfectly but without client-side Wasm. $GOPATH/binmust be in your$PATH.
TinyGo Note: TinyGo supports Go 1.19 to 1.25. If your Go version is higher, Stew will emit a non-blocking warning and continue server compilation.
1. Install the Stew CLI
go install github.com/ZiplEix/stew@latest
Verify installation:
stew version
2. Initialize a new project
mkdir my-app && cd my-app
stew init github.com/username/my-app
What does
stew init do?
- Executes
go mod initwith the provided module name - Creates
.stew.yaml,main.go, and.gitignore - Creates
pages/@layout.stewandpages/@page.stew(complete starter kit with HTMX + Wasm counter) - Copies
wasm_exec.jsfrom your local TinyGo installation tostatic/wasm/ - Executes
stew install(installsair) - Executes
stew compilethenstew generate - Executes
go mod tidy
3. Start the development server
stew run dev
Launches in parallel: stew compile --watch, stew generate --watch, and air. The server is accessible at http://localhost:8080 with Hot Morphing enabled.