Go Quick Start
Scaffold and run your first Gin + GORM project end to end
Overview
This guide walks through the default Go flow: scaffold a Gin + GORM + Goose + SQLite project, run it, and verify the health endpoint. Go projects run the CLI as the standalone tristack binary.
Install the CLI
Install the tristack binary for your OS:
powershell irm https://tristack.space/install.ps1 | iex
1. Scaffold
tristack my-apiFollow the prompts, or skip them and take the defaults completely non-interactively:
tristack my-api --yesAfter scaffolding you'll see the reproducible command, which is also saved to tristack.jsonc inside the project.
2. Run it
cd my-api
cp .env.example .env
go mod tidy
airOpen http://localhost:8000/health — you should see {"status":"ok"}.
Note
The module path is a slugged version of your project name (my-api → my_api), and the
layered packages live under <module>/internal/{config,handler,service,repository,model,db}.
The port (8000) and app name come from PORT and APP_NAME in .env.
3. Common commands
go mod tidy # install dependencies (default package manager)
go run ./cmd/api # run without the air addon
make build # compile the binary (Makefile targets: run, test, vet, fmt)
air # live reload (air addon)
golangci-lint run # lint (golangci-lint addon)Database migrations
With Goose, migrations live in migrations/:
go run github.com/pressly/goose/v3/cmd/goose@latest create create_users sql
go run github.com/pressly/goose/v3/cmd/goose@latest upWith golang-migrate, SQL files live in db/migrations/:
go run -tags 'sqlite3' github.com/golang-migrate/migrate/v4/cmd/migrate@latest \
-path db/migrations -database $DATABASE_URL upDocker
With the docker addon, run the whole stack in containers:
docker compose up --build4. Other frameworks
The stack varies by framework — same flow, different router:
| Framework | Scaffold flag | Run |
|---|---|---|
| Gin (default) | --framework gin | air / go run ./cmd/api |
| Fiber | --framework fiber | air / go run ./cmd/api |
| Echo | --framework echo | air / go run ./cmd/api |
| Chi | --framework chi | air / go run ./cmd/api |
| Go stdlib | --framework stdlib | air / go run ./cmd/api |
5. Reproduce the same stack
Every scaffold prints a reproducible command and stores it in tristack.jsonc:
tristack my-api \
--language go \
--framework gin \
--orm gorm \
--migrations goose \
--database sqlite \
--package-manager go \
--addons docker air golangci-lintOr validate it without writing anything:
tristack my-api --yes --dry-runNext steps
- Project Structure — exactly what gets generated
- CLI Options — every flag
- Compatibility — valid combinations
