# Go Quick Start (/docs/guides/go-quick-start)



## Overview [#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-cli]

Install the `tristack` binary for your OS:

<CodeBlockTabs defaultValue="windows">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="windows">
      Windows
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="macos">
      macOS
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="linux">
      Linux
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="windows">
    `powershell irm https://tristack.space/install.ps1 | iex `
  </CodeBlockTab>

  <CodeBlockTab value="macos">
    `bash curl -fsSL https://tristack.space/install.sh | bash `
  </CodeBlockTab>

  <CodeBlockTab value="linux">
    ```bash
    curl -fsSL https://tristack.space/install.sh | bash
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## 1. Scaffold [#1-scaffold]

```bash
tristack my-api
```

Follow the prompts, or skip them and take the defaults completely non-interactively:

```bash
tristack my-api --yes
```

After scaffolding you'll see the reproducible command, which is also saved to `tristack.jsonc` inside the project.

## 2. Run it [#2-run-it]

```bash
cd my-api
cp .env.example .env
go mod tidy
air
```

Open `http://localhost:8000/health` — you should see `{"status":"ok"}`.

<Callout title="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`.
</Callout>

## 3. Common commands [#3-common-commands]

```bash
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 [#database-migrations]

With Goose, migrations live in `migrations/`:

```bash
go run github.com/pressly/goose/v3/cmd/goose@latest create create_users sql
go run github.com/pressly/goose/v3/cmd/goose@latest up
```

With golang-migrate, SQL files live in `db/migrations/`:

```bash
go run -tags 'sqlite3' github.com/golang-migrate/migrate/v4/cmd/migrate@latest \
  -path db/migrations -database $DATABASE_URL up
```

### Docker [#docker]

With the `docker` addon, run the whole stack in containers:

```bash
docker compose up --build
```

## 4. Other frameworks [#4-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 [#5-reproduce-the-same-stack]

Every scaffold prints a reproducible command and stores it in `tristack.jsonc`:

```bash
tristack my-api \
  --language go \
  --framework gin \
  --orm gorm \
  --migrations goose \
  --database sqlite \
  --package-manager go \
  --addons docker air golangci-lint
```

Or validate it without writing anything:

```bash
tristack my-api --yes --dry-run
```

## Next steps [#next-steps]

* [Project Structure](/docs/project-structure) — exactly what gets generated
* [CLI Options](/docs/cli/options) — every flag
* [Compatibility](/docs/cli/compatibility) — valid combinations
