Guide / 01

Installation

Prepare your environment for cooking high-performance Go applications.

Prerequisites

  • Go 1.22+ — For net/http.ServeMux support 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/bin must 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 init with the provided module name
  • Creates .stew.yaml, main.go, and .gitignore
  • Creates pages/@layout.stew and pages/@page.stew (complete starter kit with HTMX + Wasm counter)
  • Copies wasm_exec.js from your local TinyGo installation to static/wasm/
  • Executes stew install (installs air)
  • Executes stew compile then stew 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.