Quickstart
In five minutes you will install the kiw CLI, create a static site, change a page, write your first component, and produce a production build. You only need Go 1.27.1+ and a terminal โ no Node.js, no npm, and no knowledge of Krewire's internals.
Step 1: Install kiw
On Linux or macOS:
curl -fsSL https://krewire.com/scripts/install.sh | sh
On any platform with Go 1.27.1+ (including Windows):
go install github.com/krewire/krew/cmd/krew@latest
Check that the shell can find it:
krew version
The first line reads kiw Krewire Devtool, followed by the ecosystem version and your Go version. If the command is not found, see Installation โ Configuring your PATH.
Step 2: Create a Site
krew new my-site --site --title "My Site"
cd my-site
kiw prints the files it created:
created my-site/krewire.yaml
created my-site/pages/index.kiw
created my-site/layouts/Base.kiw
created my-site/components/Hero.kiw
created my-site/public/favicon.svg
created my-site/README.md
What each one is for:
my-site/
โโโ krewire.yaml # project name, kind (site), build output, dev port
โโโ go.mod # Go module (created by krew new)
โโโ pages/index.kiw # the home page โ /
โโโ layouts/Base.kiw # the HTML shell every page renders inside
โโโ components/Hero.kiw # a reusable component, used as <Hero /> in index.kiw
โโโ public/favicon.svg # copied as-is into the build
A file in pages/ becomes a URL, a file in components/ becomes a tag, and a file in layouts/ wraps pages. That is the whole mental model for a site.
Step 3: Start the Dev Server
krew dev
INFO msg="dev server running" url=http://localhost:8080 ...
INFO msg="watching for changes" root=... interval=500ms
Open http://localhost:8080. Leave the server running for the next steps.
Step 4: Edit the Page
Replace the contents of pages/index.kiw with:
---
title: My Site
layout: Base
---
<div class="hero-container">
<h1>Hello from {{.Title}}</h1>
<p>I edited this page and the browser reloaded by itself.</p>
<Badge variant="primary" text="Built with Krewire" />
</div>
<style>
.hero-container {
max-width: 680px;
margin: 4rem auto;
text-align: center;
}
.hero-container h1 {
font-size: 2.75rem;
color: #39D353;
}
</style>
Save. The terminal logs site rebuilt successfully and the browser shows the new heading.
- The block between
---lines is frontmatter:titleis available as{{.Title}},layout: Basepickslayouts/Base.kiw. <Badge โฆ />is a component from Krewire UI โ the 66 built-in components are available in every site without installing anything. Browse them in the UI catalog.- The
<style>block is scoped: its rules only apply to this page's markup.
Step 5: Add Your Own Component
Create components/Feature.kiw:
<div class="feature">
<h3>{title}</h3>
<p>{body}</p>
</div>
<style>
.feature {
padding: 1rem 1.25rem;
border: 1px solid #30363d;
border-radius: 8px;
text-align: left;
}
.feature h3 {
margin: 0 0 0.5rem;
color: #39D353;
}
</style>
{title} reads the title attribute; {body} is whatever you put between the opening and closing tags. Use it in pages/index.kiw, below the badge:
<div class="features">
<Feature title="Fast">Pages are plain HTML generated at build time.</Feature>
<Feature title="Simple">One CLI, one config file, no npm.</Feature>
</div>
and add .features { display: grid; gap: 1rem; margin-top: 2rem; } to the page's <style> block. Save, and the two cards appear.
Tip:
krew make component Featurealso createscomponents/Feature.kiwfor you, as a starting point to edit.
Step 6: Build for Production
Stop the dev server (Ctrl+C) and run:
krew build
INFO building SSG site from file layout root=... output=.../my-site/.krewire/build
created index.html
created favicon.svg
created assets/krewire.css
.krewire/build/ is the complete website: plain HTML and CSS that any static host (Nginx, Caddy, GitHub Pages, an object bucket) can serve. Preview it exactly as it will be served:
krew serve --addr :3000
and open http://localhost:3000.
What You Learned
| Concept | Where it lives |
|---|---|
| Pages are files | pages/*.kiw โ one URL each |
| Layouts wrap pages | layout: Base โ layouts/Base.kiw |
| Components are tags | components/Feature.kiw โ <Feature> |
| Built-in UI | <Badge>, <Button>, <Card>, โฆ from Krewire UI |
| One command per step | krew new โ krew dev โ krew build โ krew serve |
Next Steps
- Build something dynamic: 2.2 Build a Fullstack App in 15 Minutes โ
- Learn the full component syntax: 2.7 The
.kiwDSL โ - Writing documentation instead? Read the Book workload.