Get started
The project generator
What create-gotth-plus-app asks, what it writes, and every flag it accepts.
How it works
The gotth-plus template is embedded in the create-gotth-plus-app binary, so the generator works offline and each version of the CLI always writes the same project. Database, sign-in and cache choices add or replace files from fixed variants, and the dependency files come from pre-computed go.mod and go.sum sets, so a new project is tidy without network access.
Every edit to the template text must match exactly once. When the template changes in a way the generator doesn't expect, generation fails and the tests say which edit broke, instead of quietly writing a wrong project.
Flags
| Flag | Default | What it does |
|---|---|---|
| [name] | asked | Project directory. . writes into the current directory. |
| --module | github.com/<user>/<name> | Go module path. |
| --port | 3000 | Development port, written to .env. |
| --auth | none | none, supabase, oidc or builtin (advanced, experimental). All but none use the app's own server-side sessions. See Sign-in. |
| --oidc-preset | other | With --auth=oidc: workos, logto, kinde, auth0, zitadel, keycloak or other. |
| --auth-methods | password | With --auth=builtin: any of password, google, github, apple. |
| --db | sqlite | sqlite, postgres or mysql. Postgres and MySQL need a server; the tests create a throwaway database on it. |
| --sqlite-driver | purego | purego (no C compiler, CGO_ENABLED=0 works) or cgo. |
| --cache | none | Server-side cache: none, redis (Redis or Redis-compatible: Valkey, KeyDB, Dragonfly, managed Redis) or memcached (Memcached or Memcached-compatible). See Server-side cache. |
| --e2e | true | Playwright browser tests. --e2e=false removes them. |
| --live-reload | templ | templ (its proxy) or air. Both reload the browser on port 7331. |
| --docker | true | Production Dockerfile (distroless, non-root) and .dockerignore. |
| --ci | true | GitHub Actions workflow. |
| --js | true | Download and commit htmx, its preload extension, Alpine (CSP) and hx-optimistic, with their SHA-384 hashes. |
| --axe | true | Download axe-core (sha512-verified) for the accessibility test. |
| --git | true | git init and a first commit. |
| --setup | true | Run make setup. |
| --yes, -y | Ask nothing: flags, then defaults. For scripts and AI agents. | |
| --force | Write into a directory that is not empty. |
Sign-in
The default is no sign-in, which suits learning and prototypes. For production the generator recommends a hosted service: Supabase Auth (--auth=supabase, which moves the database to Postgres) or any OpenID Connect provider (--auth=oidc). The built-in option (--auth=builtin) is labelled experimental and only for advanced use, and the generated SECURITY.md says so. Sign-in covers what each option sets up.
Live reload
make dev reloads the browser at http://localhost:7331 after every change, and runs the Tailwind watcher beside the reloader. --live-reload picks the reloader.
- templ (the default): templ's own watcher regenerates the views, rebuilds and restarts the server, and its proxy reloads the browser. Nothing else to install.
- air: air rebuilds on every .go or .templ change, running templ generate first so the build never uses stale generated files, and its proxy reloads the browser on the same port. Install it with go install github.com/air-verse/air@latest. Its settings are in air.toml.
Browser tests
--e2e (on by default) keeps the Playwright-Go browser tests, and make setup downloads the Chromium they drive. Besides the example app, they check things any app needs: visible focus rings, accessible toasts, no third-party requests, no sideways scrolling on a phone, and pages that load without JavaScript.
--axe (on by default with --e2e) downloads axe-core from the npm registry, checked against its sha512 hash, for an accessibility scan. Without it, that scan is skipped.
--e2e=false removes the browser tests, their make targets and the Chromium download, so make test needs no browser. Nothing then catches a CDN script or font sneaking past the Content-Security-Policy, so the README suggests adding the generic checks back from the gotth-plus repository before production.
JavaScript libraries
htmx, its preload extension, Alpine's CSP build and hx-optimistic are plain files in static/js, downloaded by make js. --js (on by default) downloads them during setup, records each version and SHA-384 hash in the README, and commits them, so production serves copies you have pinned and reviewed.
With --js=false, the files are git-ignored and downloaded later with make js. Commit them before you deploy: the Dockerfile refuses to build without them, and a production build must never download them, because make js fetches the latest versions.
Docker and CI
--docker (on by default) adds a Dockerfile, a .dockerignore and make docker. The image builds the CSS with a pinned, checksum-verified Tailwind CLI and builds the server, then copies both into a distroless image that runs as a non-root user with GoEnv=production on port 8080. On SQLite, the database file lives on a volume at /data. On Postgres and MySQL, pass DatabaseURL at runtime from the platform's secret store: it is never baked into the image. The CGO SQLite driver needs glibc, so that one choice uses a slightly larger distroless base.
--ci (on by default) adds a GitHub Actions workflow, with actions pinned by commit. It runs go mod verify, checks that templ generate, templ fmt and gofmt change nothing, then runs make vet, make test and make vuln. On Postgres or MySQL it starts a database server for the tests. With --docker, it also checks that the production image builds.
Git and setup
- --git (on by default) runs git init and makes a first commit, so the project starts from a clean, committed state.
- --setup (on by default) runs make setup: the Go modules, the JavaScript libraries, Chromium for the browser tests, and a first build. With --setup=false, run make setup yourself.
- --yes asks nothing: flags first, then defaults. With --yes, the project name is required.
Was this page helpful?
Be the first to answer.