Getting Started

This chapter is the beginner track. It assumes you know a little Go and a terminal β€” nothing else. You do not need to know about architecture layers, dependency graphs, scope levels, or ADRs to build with Krewire; those live in the separate Architecture Deep-Dive for platform engineers and contributors.


1. The Beginner Track

Follow these in order. Every command in them was run against the current kiw CLI.

Install kiw, scaffold a static site, edit a page, add your own component, run the dev server, and produce a production build.

A task manager with krew new --app, SQLite through pkg/orm, a .kiw page with Krewire UI components, validated CSRF-protected forms, and a single-binary build.

When you finish the track, keep the reference pages of this chapter at hand:

# Page Read it when you want to…
2.3 Installation install on another OS, pin a version, or set up shell completion.
2.4 Configuration understand every field of krewire.yaml.
2.5 Directory Structure know where files go for each workload.
2.6 Agentic Development pair with AI coding agents on a Krewire project.
2.7 The .kiw DSL learn the full component syntax: props, slots, scoped CSS, scripts.

2. Prerequisites

Requirement Version Check with
Go 1.27.1 or newer go version
Git any recent version git --version
OS Linux, macOS, or Windows (PowerShell or WSL2) β€”

Krewire needs no Node.js, no npm, and no bundler. If Go is missing or older than 1.27.1, install it from go.dev/dl first.


3. Which Workload Should I Start With?

Every Krewire project has one kind. Pick the row that matches what you are building β€” you can grow into the others later without moving your components.

I want to build… Kind Scaffold Learn more
A website, landing page, or blog site krew new my-site --site Site workload
Documentation or a book book krew new my-docs --book Book workload
A web app with a database and forms app krew new my-app --app App workload
A command-line tool cli krew new my-tool --cli CLI workload
A background job processor worker krew new my-worker --worker Worker workload
An HTTP microservice service krew new my-svc --service Service workload
A reverse proxy in front of services gateway krew new my-gw --gateway Gateway workload
Cloud infrastructure definitions infra krew new my-infra --infra Infra workload

Not sure? Start with --site (Quickstart) or --app (Fullstack tutorial).


4. Everyday Commands

Command What it does
krew new <name> --site Create a new project (--app, --book, --cli, … for other kinds).
krew dev Run the project locally with rebuild on save (http://localhost:8080).
krew build Production build: static files in .krewire/build/ for sites and books, a binary in .krewire/build/bin/ for apps.
krew serve --addr :3000 Preview the static build over HTTP.
krew make component Card Generate a starter file (component, page, model, migration, handler, …).
krew test Run the project's Go tests.
krew doctor Diagnose your toolchain and workspace.
krew help <command> Show the options of any command.

The complete list is in the CLI Command Reference.


5. Common Beginner Pitfalls

kiw: command not found β€” the install directory is not on your PATH. Add export PATH="$HOME/.local/bin:$PATH" (shell installer) or export PATH="$(go env GOPATH)/bin:$PATH" (go install) to ~/.zshrc or ~/.bashrc, then open a new terminal.

address already in use β€” another program owns port 8080. Change dev.port in krewire.yaml, or preview a build on another address with krew serve --addr :3000.

requires go >= 1.27.1 β€” your Go is older than the one Krewire targets. Install a current Go from go.dev/dl; distribution packages are often several versions behind.


Next Steps