Your First Loom Project — Quickstart
In about five minutes you'll go from an empty directory to a running HTTP API with a Customer model, validated YAML, generated Go + SvelteKit + SQL, and live JWT auth.
1. Scaffold a new project
loom new my-app
cd my-app
This creates loom.yaml, threads/, custom/, README.md, and .gitignore. With GITHUB_TOKEN set, loom new also creates the GitHub repo. With ORBWEAVER_API_KEY set, it registers the project in OrbWeaver. Both are optional.
2. Define your first model
loom add model Customer
This drops a starter threads/customer.yaml. Open it and edit fields, permissions, and the form view. The schema is documented at the Thread YAML Schema Reference.
3. Validate
loom check
Reports parse errors, missing required fields, duplicate field names, and broken cross-references in list_view / form_view. Exits non-zero on failure.
4. Weave
loom weave
Generates ten files per Thread under .loom/: a Go model + handler + routes + handler test, three SvelteKit pages, two HTMX partials, and one SQL CREATE TABLE migration.
5. Bring up the database
export DATABASE_URL='mysql://user:pass@host/dbname?tls=true'
loom stitch --preview # see what Loom would do
loom stitch # apply (with a confirmation prompt)
loom stitch only emits CREATE TABLE and ADD COLUMN automatically. Type changes, dropped columns, and orphan tables are surfaced as warnings the operator must resolve by hand.
6. Serve it
export LOOM_SECRET=$(openssl rand -hex 32)
loom serve
The server listens on :8080 by default. Public routes:
GET /healthz— liveness probe (no auth)GET|POST|PUT|DELETE /api/customers/[id]— CRUD over the Customer Thread, JWT-protected, permission-gated
Pass --no-auth for unauthenticated dev mode (only Threads granting role: Public are reachable).
What's next
- Concepts → Threads for how Loom thinks about data
- Tutorials → Build a Simple CRM for a multi-model walkthrough
- Reference → CLI Command Reference for every flag