@shaferllc/keel 0.83.5 → 0.83.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -5,10 +5,11 @@ house framework for Node.js — or an app built on it. Humans: this is also a fa
5
5
  orientation. For prose guides see [`docs/`](./docs); for a machine-readable
6
6
  surface, run the [MCP server](#mcp-server-recommended).
7
7
 
8
- > **The fastest path:** connect the Keel MCP server (below) and call
9
- > `keel_overview` first. It returns conventions, the folder map, every doc
10
- > topic, and the generators. Then `keel_search_docs` / `keel_read_doc` for
11
- > depth, `keel_search_api` to find exports, `keel_scaffold` to generate code.
8
+ > **The fastest path:** follow
9
+ > [`docs/from-install-to-deploy.md`](./docs/from-install-to-deploy.md)
10
+ > (create-keeljs local Cloudflare or optional Keel Cloud). For deep
11
+ > lookups, connect the MCP server and call `keel_overview`, then
12
+ > `keel_search_docs` / `keel_search_api`.
12
13
 
13
14
  ---
14
15
 
package/README.md CHANGED
@@ -61,19 +61,29 @@ export class HomeController {
61
61
  - **Thin and legible.** The whole framework is a few hundred lines in
62
62
  `src/core/`. No magic you can't read.
63
63
 
64
- ## Two repos: the framework and your app
64
+ ## Two pieces: the framework and your app
65
65
 
66
- Keel is distributed the same way most frameworks are a **library** you install,
67
- plus an **app** that depends on it:
66
+ Keel is a **library** you install. New apps come from the generator (templates
67
+ ship inside the package so they cannot lag the framework):
68
+
69
+ ```bash
70
+ npm create keeljs@latest my-app
71
+ cd my-app && npm install && npm run dev
72
+ ```
73
+
74
+ End-to-end (local → Cloudflare or optional Keel Cloud):
75
+ [From install to deploy](./docs/from-install-to-deploy.md).
68
76
 
69
77
  | Repo | Role |
70
78
  |------|------|
71
79
  | [`shaferllc/keel`](https://github.com/shaferllc/keel) (this repo) | The framework. Published as `@shaferllc/keel`. |
72
- | [`shaferllc/keel-app`](https://github.com/shaferllc/keel-app) | The starter appclone it to build something. Gets core updates via `npm update`. |
80
+ | Your app (via `create-keeljs`) | Routes, models, viewsdepends on `@shaferllc/keel`. |
73
81
 
74
82
  ## Install in your app
75
83
 
76
84
  ```bash
85
+ npm create keeljs@latest my-app
86
+ # or, into an existing project:
77
87
  npm install @shaferllc/keel
78
88
  ```
79
89
 
@@ -81,24 +91,20 @@ npm install @shaferllc/keel
81
91
  import { Application, Router, config } from "@shaferllc/keel/core";
82
92
  ```
83
93
 
84
- Or clone the [starter app](https://github.com/shaferllc/keel-app) and start
85
- from a working skeleton.
86
-
87
94
  ## Hack on the framework itself
88
95
 
89
96
  ```bash
90
97
  git clone https://github.com/shaferllc/keel.git
91
98
  cd keel
92
99
  npm install
93
- npm test # 740 tests
94
- npm run typecheck # src + tests
95
- npm run build # compile the package to dist/
96
- npm run verify:release # build from what's committed — what a consumer's install runs
100
+ npm test
101
+ npm run typecheck
102
+ npm run build
103
+ npm run verify:release
97
104
  ```
98
105
 
99
- This repo is **the framework, and only the framework** — there is no app in it. To
100
- run one, clone the [starter app](https://github.com/shaferllc/keel-app) and point it
101
- at your checkout (`"@shaferllc/keel": "file:../keel"`).
106
+ Point a generated kit at your checkout with
107
+ `"@shaferllc/keel": "file:../keel"` while developing.
102
108
 
103
109
  ## The console
104
110
 
@@ -192,7 +198,9 @@ See [docs/architecture.md](./docs/architecture.md) for the full picture.
192
198
 
193
199
  | Guide | What it covers |
194
200
  |-------|----------------|
195
- | [Getting Started](./docs/getting-started.md) | Install, run, first route and controller |
201
+ | [Getting Started](./docs/getting-started.md) | First route, controller, view, config |
202
+ | [From install to deploy](./docs/from-install-to-deploy.md) | create-keeljs → local → Cloudflare or Keel Cloud |
203
+ | [Starter kits](./docs/starter-kits.md) | Presets (`minimal` / `api` / `app` / `saas`) |
196
204
  | [The Service Container](./docs/container.md) | Binding and resolving services, DI |
197
205
  | [Service Providers](./docs/providers.md) | Plugin system: register/boot lifecycle, options |
198
206
  | [Configuration](./docs/configuration.md) | `config/*.ts`, dot-notation, `env()` |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaferllc/keel",
3
- "version": "0.83.5",
3
+ "version": "0.83.6",
4
4
  "description": "The house framework for Node.js — a service container, providers, routing, JSX views, and a code-generating console.",
5
5
  "repo": "https://github.com/shaferllc/keel",
6
6
  "generated": "run `npm run build:ai` to regenerate",
@@ -159,6 +159,13 @@
159
159
  "path": "docs/factories.md",
160
160
  "example": "docs/examples/factories.ts"
161
161
  },
162
+ {
163
+ "slug": "from-install-to-deploy",
164
+ "title": "From install to deploy",
165
+ "summary": "One path from zero to a live Keel app — locally, on Cloudflare yourself, or on Keel Cloud with an AI agent.",
166
+ "path": "docs/from-install-to-deploy.md",
167
+ "example": null
168
+ },
162
169
  {
163
170
  "slug": "gates",
164
171
  "title": "Gates",
package/docs/ai.md CHANGED
@@ -5,8 +5,9 @@ AI-facing surface: an MCP server, machine-readable docs (`llms.txt` /
5
5
  `llms-full.txt`), an agent playbook (`AGENTS.md`), and code generators an agent
6
6
  can drive directly.
7
7
 
8
- If you only read one thing: point your agent at the [MCP server](#the-mcp-server)
9
- and have it call `keel_overview` first.
8
+ If you only read one thing: follow
9
+ [From install to deploy](./from-install-to-deploy.md), then point your agent at
10
+ the [MCP server](#the-mcp-server) and have it call `keel_overview` first.
10
11
 
11
12
  ## Why this exists
12
13
 
package/docs/changelog.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to Keel are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project aims to
5
5
  adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.83.6] — 2026-07-13
8
+
9
+ ### Documentation
10
+
11
+ - **[From install to deploy](./docs/from-install-to-deploy.md)** — end-to-end
12
+ guide: `create-keeljs` → local dev → Cloudflare self-deploy → optional Keel
13
+ Cloud + MCP. Getting Started and the README now lead with the generator.
14
+
15
+ [0.83.6]: https://github.com/shaferllc/keel/releases/tag/v0.83.6
16
+
7
17
  ## [0.83.5] — 2026-07-13
8
18
 
9
19
  ### Added
@@ -0,0 +1,186 @@
1
+ # From install to deploy
2
+
3
+ One path from zero to a live Keel app — locally, on Cloudflare yourself, or on
4
+ **Keel Cloud** with an AI agent. Pick the track that matches how you want to
5
+ ship; everything else is optional.
6
+
7
+ ```text
8
+ create-keeljs → npm run dev → (optional MCP) → deploy
9
+
10
+ Keel Cloud (optional)
11
+ ```
12
+
13
+ ## Requirements
14
+
15
+ - Node.js **≥ 22**
16
+ - npm
17
+ - For self-hosted edge deploys: a [Cloudflare](https://dash.cloudflare.com) account
18
+ and [Wrangler](https://developers.cloudflare.com/workers/wrangler/) (ships with
19
+ the kits as a devDependency)
20
+ - For Keel Cloud: an invite / allowlisted email at [app.keeljs.cloud](https://app.keeljs.cloud)
21
+ during private alpha
22
+
23
+ ## 1. Create an app
24
+
25
+ ```bash
26
+ npm create keeljs@latest my-app # full-stack "app" preset (default)
27
+ # npm create keeljs@latest my-api -- --preset api
28
+ # npm create keeljs@latest my-saas -- --preset saas
29
+ # npm create keeljs@latest bare -- --preset minimal
30
+ cd my-app
31
+ npm install
32
+ cp .env.example .env # if the kit didn't already
33
+ ```
34
+
35
+ | Preset | Use when |
36
+ |--------|----------|
37
+ | `minimal` | Hello-world / learning — routes, a view, Tailwind. No database. |
38
+ | `api` | JSON API — models, migrations, token auth, OpenAPI, tests. |
39
+ | `app` *(default)* | Product with views, sessions, register/login, password reset, 2FA. |
40
+ | `saas` | Multi-tenant product — teams, roles, invitations, billing. |
41
+
42
+ Templates live **inside** `@shaferllc/keel`, so the kit version matches the
43
+ framework version you just installed. Details: [Starter kits](./starter-kits.md).
44
+
45
+ ## 2. Run it locally
46
+
47
+ ```bash
48
+ npm run migrate # if the preset has a database (api / app / saas)
49
+ npm run dev # http://localhost:3000 — Node + local SQLite
50
+ ```
51
+
52
+ Useful next commands:
53
+
54
+ ```bash
55
+ npm run keel -- routes # what is mounted
56
+ npm run keel -- make:controller Post # scaffold, then wire a route
57
+ npm test
58
+ npm run typecheck
59
+ ```
60
+
61
+ Local tip: `DB_CONNECTION` defaults to a SQLite file. Switching drivers later is
62
+ config only — see [Database](./database.md) and [Starter kits](./starter-kits.md).
63
+
64
+ For a guided first hour inside the codebase (routes, controllers, views, config),
65
+ read [Getting Started](./getting-started.md).
66
+
67
+ ## 3. Optional — AI agents (local)
68
+
69
+ Keel is designed to be written with an agent. Point Cursor / Claude Code at the
70
+ MCP server that ships with the package:
71
+
72
+ ```json
73
+ {
74
+ "mcpServers": {
75
+ "keel": {
76
+ "command": "npx",
77
+ "args": ["-y", "keel-mcp"]
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ Then have the agent call `keel_overview` first. It can search docs, look up the
84
+ public API, and scaffold controllers/jobs/… without inventing imports.
85
+
86
+ Full map: [Building with AI](./ai.md).
87
+
88
+ ## 4. Deploy yourself (Cloudflare Workers)
89
+
90
+ Every kit includes `wrangler.jsonc`, a `worker.ts` entry, and `npm run deploy`.
91
+ You own the Cloudflare account and the hostname.
92
+
93
+ ```bash
94
+ # one-time
95
+ npx wrangler login
96
+ npx wrangler d1 create my-app # paste database_id into wrangler.jsonc
97
+
98
+ # ship
99
+ npm run deploy # css:build + wrangler deploy
100
+ ```
101
+
102
+ Migrations against remote D1 use the HTTP driver from your laptop / CI — the
103
+ binding only exists inside the Worker. Set Cloudflare API credentials as
104
+ documented in [Database](./database.md) (D1 HTTP) and your kit’s README.
105
+
106
+ Edge preview without deploying:
107
+
108
+ ```bash
109
+ npm run dev:edge # wrangler + local D1
110
+ ```
111
+
112
+ Hosting helpers (hostname utils, SQL dump, secrets encryption) live in
113
+ [`@shaferllc/keel/hosting`](./hosting.md) if you build your own control plane.
114
+
115
+ ## 5. Optional — Keel Cloud
116
+
117
+ [Keel Cloud](https://app.keeljs.cloud) is a hosted control plane: pick a preset,
118
+ edit real source, preview and publish Workers for you, vault secrets, and export
119
+ git + SQL anytime. Free tier is limited (typically one site); Pro adds more sites
120
+ and custom domains.
121
+
122
+ Use Cloud when you want the platform to own deploys and hostnames. Skip it when
123
+ you already have Cloudflare / your own pipeline (§4).
124
+
125
+ ### Sign up and mint a token
126
+
127
+ 1. Open [app.keeljs.cloud](https://app.keeljs.cloud) (invite code or allowlisted
128
+ email during alpha).
129
+ 2. Create a personal access token at **`/tokens`**. The plaintext looks like
130
+ `keel_<selector>.<verifier>` — copy it once.
131
+ 3. Wire it into your MCP client (same `keel-mcp` binary as local):
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "keel": {
137
+ "command": "npx",
138
+ "args": ["-y", "keel-mcp"],
139
+ "env": {
140
+ "KEEL_CLOUD_TOKEN": "keel_….…",
141
+ "KEEL_CLOUD_URL": "https://app.keeljs.cloud"
142
+ }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ Reload MCP. When the token is set, `keel_cloud_*` tools appear alongside the
149
+ docs tools. The token binds to your **first team**.
150
+
151
+ ### Agent loop on Cloud
152
+
153
+ 1. `keel_cloud_create_site { name: "Acme", preset: "app" }`
154
+ 2. Edit files at the returned `storage_path` (real Keel app + git)
155
+ 3. `keel_cloud_set_secret` for anything the Worker needs at runtime
156
+ 4. `keel_cloud_preview { site_id }` — iterate freely
157
+ 5. `keel_cloud_publish { site_id, confirm: true }` — only after you approve
158
+ 6. Optional Pro: `keel_cloud_set_custom_domain { hostname, attach: true }`
159
+ 7. Escape hatch anytime: `keel_cloud_export` + `keel_cloud_export_sql`
160
+
161
+ You can also drive the same flow from the dashboard at `/sites`. Billing for Pro
162
+ is at `/billing` (or `keel_cloud_billing` / `_checkout` / `_portal` via MCP).
163
+
164
+ Tool reference: [Building with AI](./ai.md#the-mcp-server).
165
+
166
+ ## Which path should I pick?
167
+
168
+ | Goal | Path |
169
+ |------|------|
170
+ | Learn Keel / ship a side project on your CF account | §§1–4 |
171
+ | Build with an agent in your IDE, deploy yourself | §§1–4 + §3 |
172
+ | Let the platform host preview/prod + secrets + export | §§1–2 + §5 (Cloud creates the app for you) |
173
+ | Multi-tenant SaaS with billing | Preset `saas`, then §4 or §5 |
174
+
175
+ Cloud **create_site** scaffolds a kit the same way `create-keeljs` does — you do
176
+ not need both for the same app. Use `create-keeljs` for apps you own end-to-end;
177
+ use Cloud when you want hosted preview/publish under `*.keeljs.cloud`.
178
+
179
+ ## Where next
180
+
181
+ - [Getting Started](./getting-started.md) — first route, controller, view
182
+ - [Starter kits](./starter-kits.md) — presets and the Node/edge seam
183
+ - [Building with AI](./ai.md) — MCP tools (local + Cloud)
184
+ - [Hosting](./hosting.md) — Cloudflare / dump / secrets primitives
185
+ - [Accounts](./accounts.md) · [Teams](./teams.md) · [Billing](./billing.md) — what
186
+ `app` / `saas` already mount
@@ -15,32 +15,20 @@ Keel targets modern Node and web-standard APIs, so a current runtime matters —
15
15
 
16
16
  ## Install
17
17
 
18
- Keel ships as two repos: the **framework** (`@shaferllc/keel`, published to
19
- npm) and a **starter app** (`shaferllc/keel-app`) you build on. Which path you
20
- take depends on whether you're starting fresh or bolting Keel onto something
21
- that already exists. See [Architecture](./architecture.md#two-repos-library-and-starter)
22
- for why it's split this way.
23
-
24
- ### From the starter (recommended)
25
-
26
- The fastest route to a running app is the starter — a working skeleton with the
27
- folders, config, and scripts already wired:
18
+ The fastest path to a running app is the generator it copies a curated kit
19
+ from the same `@shaferllc/keel` version you install, so the template cannot lag
20
+ the framework:
28
21
 
29
22
  ```bash
30
- git clone https://github.com/shaferllc/keel-app.git my-app
23
+ npm create keeljs@latest my-app
31
24
  cd my-app
32
25
  npm install
26
+ npm run dev # http://localhost:3000
33
27
  ```
34
28
 
35
- The starter depends on `@shaferllc/keel`, so you pick up framework updates with
36
- an ordinary `npm update @shaferllc/keel` your app code in `app/` stays put.
37
-
38
- A fresh checkout ships with a working `.env`. To start from the template
39
- instead:
40
-
41
- ```bash
42
- cp .env.example .env
43
- ```
29
+ For the full journey (presets, Cloudflare deploy, optional Keel Cloud + MCP),
30
+ see **[From install to deploy](./from-install-to-deploy.md)**. Kit details:
31
+ [Starter kits](./starter-kits.md).
44
32
 
45
33
  ### Into an existing app
46
34
 
@@ -57,22 +45,24 @@ import { Application, Router, config } from "@shaferllc/keel/core";
57
45
  ```
58
46
 
59
47
  You supply the four convention folders yourself — `app/`, `config/`, `routes/`,
60
- `bootstrap/` — plus an entry that calls `createApplication()`. The starter's
48
+ `bootstrap/` — plus an entry that calls `createApplication()`. A generated kit’s
61
49
  `bootstrap/app.ts` is the reference; copy it and trim to taste.
62
50
 
63
51
  ### Hacking on the framework itself
64
52
 
65
- To work on Keel proper, clone the framework repo — it carries an example app you
66
- can run directly:
53
+ To work on Keel proper, clone the framework repo:
67
54
 
68
55
  ```bash
69
56
  git clone https://github.com/shaferllc/keel.git
70
57
  cd keel
71
58
  npm install
72
- npm run dev # example app on http://localhost:3000
73
- npm run build # compile the package to dist/
59
+ npm test
60
+ npm run typecheck
74
61
  ```
75
62
 
63
+ Generate a disposable app against your checkout with
64
+ `npm create keeljs@latest …` and point its dependency at `file:../keel`.
65
+
76
66
  ## Run the server
77
67
 
78
68
  ```bash
@@ -267,9 +257,10 @@ unsure what's mounted. [The Console](./console.md) lists every command.
267
257
  ## Where to go next
268
258
 
269
259
  You now have the shape of a Keel app: routes point at controllers, controllers
270
- render views and read config, and the console scaffolds the pieces. The deep
271
- guides pick up from here:
260
+ render views and read config, and the console scaffolds the pieces.
272
261
 
262
+ - **[From install to deploy](./from-install-to-deploy.md)** — presets, Cloudflare,
263
+ optional Keel Cloud + MCP
273
264
  - [Architecture](./architecture.md) — how boot, the container, and the request
274
265
  lifecycle fit together
275
266
  - [The Service Container](./container.md) — how dependency injection works
@@ -284,6 +275,7 @@ guides pick up from here:
284
275
  the active-record layer on top of it
285
276
  - [Configuration](./configuration.md) and [The Console](./console.md) — settings
286
277
  and commands
278
+ - [Building with AI](./ai.md) — MCP docs + Cloud tools
287
279
 
288
280
  When something isn't documented, open the source — the whole framework is a few
289
281
  hundred readable lines in `src/core/`, and [Built on Hono](./hono.md) explains
@@ -5,7 +5,8 @@ npm create keeljs@latest my-app -- --preset saas
5
5
  ```
6
6
 
7
7
  Four curated applications. Each is a complete, working app — not a scaffold you have
8
- to finish.
8
+ to finish. For the full path from this command through Cloudflare or Keel Cloud,
9
+ see [From install to deploy](./from-install-to-deploy.md).
9
10
 
10
11
  | Preset | What you get |
11
12
  | --- | --- |
package/llms-full.txt CHANGED
@@ -7,6 +7,199 @@ https://github.com/shaferllc/keel/blob/main/docs. Generated by `npm run build:ai
7
7
 
8
8
 
9
9
 
10
+ ---
11
+
12
+ <!-- source: docs/from-install-to-deploy.md -->
13
+
14
+ # From install to deploy
15
+
16
+ One path from zero to a live Keel app — locally, on Cloudflare yourself, or on
17
+ **Keel Cloud** with an AI agent. Pick the track that matches how you want to
18
+ ship; everything else is optional.
19
+
20
+ ```text
21
+ create-keeljs → npm run dev → (optional MCP) → deploy
22
+
23
+ Keel Cloud (optional)
24
+ ```
25
+
26
+ ## Requirements
27
+
28
+ - Node.js **≥ 22**
29
+ - npm
30
+ - For self-hosted edge deploys: a [Cloudflare](https://dash.cloudflare.com) account
31
+ and [Wrangler](https://developers.cloudflare.com/workers/wrangler/) (ships with
32
+ the kits as a devDependency)
33
+ - For Keel Cloud: an invite / allowlisted email at [app.keeljs.cloud](https://app.keeljs.cloud)
34
+ during private alpha
35
+
36
+ ## 1. Create an app
37
+
38
+ ```bash
39
+ npm create keeljs@latest my-app # full-stack "app" preset (default)
40
+ # npm create keeljs@latest my-api -- --preset api
41
+ # npm create keeljs@latest my-saas -- --preset saas
42
+ # npm create keeljs@latest bare -- --preset minimal
43
+ cd my-app
44
+ npm install
45
+ cp .env.example .env # if the kit didn't already
46
+ ```
47
+
48
+ | Preset | Use when |
49
+ |--------|----------|
50
+ | `minimal` | Hello-world / learning — routes, a view, Tailwind. No database. |
51
+ | `api` | JSON API — models, migrations, token auth, OpenAPI, tests. |
52
+ | `app` *(default)* | Product with views, sessions, register/login, password reset, 2FA. |
53
+ | `saas` | Multi-tenant product — teams, roles, invitations, billing. |
54
+
55
+ Templates live **inside** `@shaferllc/keel`, so the kit version matches the
56
+ framework version you just installed. Details: [Starter kits](./starter-kits.md).
57
+
58
+ ## 2. Run it locally
59
+
60
+ ```bash
61
+ npm run migrate # if the preset has a database (api / app / saas)
62
+ npm run dev # http://localhost:3000 — Node + local SQLite
63
+ ```
64
+
65
+ Useful next commands:
66
+
67
+ ```bash
68
+ npm run keel -- routes # what is mounted
69
+ npm run keel -- make:controller Post # scaffold, then wire a route
70
+ npm test
71
+ npm run typecheck
72
+ ```
73
+
74
+ Local tip: `DB_CONNECTION` defaults to a SQLite file. Switching drivers later is
75
+ config only — see [Database](./database.md) and [Starter kits](./starter-kits.md).
76
+
77
+ For a guided first hour inside the codebase (routes, controllers, views, config),
78
+ read [Getting Started](./getting-started.md).
79
+
80
+ ## 3. Optional — AI agents (local)
81
+
82
+ Keel is designed to be written with an agent. Point Cursor / Claude Code at the
83
+ MCP server that ships with the package:
84
+
85
+ ```json
86
+ {
87
+ "mcpServers": {
88
+ "keel": {
89
+ "command": "npx",
90
+ "args": ["-y", "keel-mcp"]
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ Then have the agent call `keel_overview` first. It can search docs, look up the
97
+ public API, and scaffold controllers/jobs/… without inventing imports.
98
+
99
+ Full map: [Building with AI](./ai.md).
100
+
101
+ ## 4. Deploy yourself (Cloudflare Workers)
102
+
103
+ Every kit includes `wrangler.jsonc`, a `worker.ts` entry, and `npm run deploy`.
104
+ You own the Cloudflare account and the hostname.
105
+
106
+ ```bash
107
+ # one-time
108
+ npx wrangler login
109
+ npx wrangler d1 create my-app # paste database_id into wrangler.jsonc
110
+
111
+ # ship
112
+ npm run deploy # css:build + wrangler deploy
113
+ ```
114
+
115
+ Migrations against remote D1 use the HTTP driver from your laptop / CI — the
116
+ binding only exists inside the Worker. Set Cloudflare API credentials as
117
+ documented in [Database](./database.md) (D1 HTTP) and your kit’s README.
118
+
119
+ Edge preview without deploying:
120
+
121
+ ```bash
122
+ npm run dev:edge # wrangler + local D1
123
+ ```
124
+
125
+ Hosting helpers (hostname utils, SQL dump, secrets encryption) live in
126
+ [`@shaferllc/keel/hosting`](./hosting.md) if you build your own control plane.
127
+
128
+ ## 5. Optional — Keel Cloud
129
+
130
+ [Keel Cloud](https://app.keeljs.cloud) is a hosted control plane: pick a preset,
131
+ edit real source, preview and publish Workers for you, vault secrets, and export
132
+ git + SQL anytime. Free tier is limited (typically one site); Pro adds more sites
133
+ and custom domains.
134
+
135
+ Use Cloud when you want the platform to own deploys and hostnames. Skip it when
136
+ you already have Cloudflare / your own pipeline (§4).
137
+
138
+ ### Sign up and mint a token
139
+
140
+ 1. Open [app.keeljs.cloud](https://app.keeljs.cloud) (invite code or allowlisted
141
+ email during alpha).
142
+ 2. Create a personal access token at **`/tokens`**. The plaintext looks like
143
+ `keel_<selector>.<verifier>` — copy it once.
144
+ 3. Wire it into your MCP client (same `keel-mcp` binary as local):
145
+
146
+ ```json
147
+ {
148
+ "mcpServers": {
149
+ "keel": {
150
+ "command": "npx",
151
+ "args": ["-y", "keel-mcp"],
152
+ "env": {
153
+ "KEEL_CLOUD_TOKEN": "keel_….…",
154
+ "KEEL_CLOUD_URL": "https://app.keeljs.cloud"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ Reload MCP. When the token is set, `keel_cloud_*` tools appear alongside the
162
+ docs tools. The token binds to your **first team**.
163
+
164
+ ### Agent loop on Cloud
165
+
166
+ 1. `keel_cloud_create_site { name: "Acme", preset: "app" }`
167
+ 2. Edit files at the returned `storage_path` (real Keel app + git)
168
+ 3. `keel_cloud_set_secret` for anything the Worker needs at runtime
169
+ 4. `keel_cloud_preview { site_id }` — iterate freely
170
+ 5. `keel_cloud_publish { site_id, confirm: true }` — only after you approve
171
+ 6. Optional Pro: `keel_cloud_set_custom_domain { hostname, attach: true }`
172
+ 7. Escape hatch anytime: `keel_cloud_export` + `keel_cloud_export_sql`
173
+
174
+ You can also drive the same flow from the dashboard at `/sites`. Billing for Pro
175
+ is at `/billing` (or `keel_cloud_billing` / `_checkout` / `_portal` via MCP).
176
+
177
+ Tool reference: [Building with AI](./ai.md#the-mcp-server).
178
+
179
+ ## Which path should I pick?
180
+
181
+ | Goal | Path |
182
+ |------|------|
183
+ | Learn Keel / ship a side project on your CF account | §§1–4 |
184
+ | Build with an agent in your IDE, deploy yourself | §§1–4 + §3 |
185
+ | Let the platform host preview/prod + secrets + export | §§1–2 + §5 (Cloud creates the app for you) |
186
+ | Multi-tenant SaaS with billing | Preset `saas`, then §4 or §5 |
187
+
188
+ Cloud **create_site** scaffolds a kit the same way `create-keeljs` does — you do
189
+ not need both for the same app. Use `create-keeljs` for apps you own end-to-end;
190
+ use Cloud when you want hosted preview/publish under `*.keeljs.cloud`.
191
+
192
+ ## Where next
193
+
194
+ - [Getting Started](./getting-started.md) — first route, controller, view
195
+ - [Starter kits](./starter-kits.md) — presets and the Node/edge seam
196
+ - [Building with AI](./ai.md) — MCP tools (local + Cloud)
197
+ - [Hosting](./hosting.md) — Cloudflare / dump / secrets primitives
198
+ - [Accounts](./accounts.md) · [Teams](./teams.md) · [Billing](./billing.md) — what
199
+ `app` / `saas` already mount
200
+
201
+
202
+
10
203
  ---
11
204
 
12
205
  <!-- source: docs/getting-started.md -->
@@ -28,32 +221,20 @@ Keel targets modern Node and web-standard APIs, so a current runtime matters —
28
221
 
29
222
  ## Install
30
223
 
31
- Keel ships as two repos: the **framework** (`@shaferllc/keel`, published to
32
- npm) and a **starter app** (`shaferllc/keel-app`) you build on. Which path you
33
- take depends on whether you're starting fresh or bolting Keel onto something
34
- that already exists. See [Architecture](./architecture.md#two-repos-library-and-starter)
35
- for why it's split this way.
36
-
37
- ### From the starter (recommended)
38
-
39
- The fastest route to a running app is the starter — a working skeleton with the
40
- folders, config, and scripts already wired:
224
+ The fastest path to a running app is the generator it copies a curated kit
225
+ from the same `@shaferllc/keel` version you install, so the template cannot lag
226
+ the framework:
41
227
 
42
228
  ```bash
43
- git clone https://github.com/shaferllc/keel-app.git my-app
229
+ npm create keeljs@latest my-app
44
230
  cd my-app
45
231
  npm install
232
+ npm run dev # http://localhost:3000
46
233
  ```
47
234
 
48
- The starter depends on `@shaferllc/keel`, so you pick up framework updates with
49
- an ordinary `npm update @shaferllc/keel` your app code in `app/` stays put.
50
-
51
- A fresh checkout ships with a working `.env`. To start from the template
52
- instead:
53
-
54
- ```bash
55
- cp .env.example .env
56
- ```
235
+ For the full journey (presets, Cloudflare deploy, optional Keel Cloud + MCP),
236
+ see **[From install to deploy](./from-install-to-deploy.md)**. Kit details:
237
+ [Starter kits](./starter-kits.md).
57
238
 
58
239
  ### Into an existing app
59
240
 
@@ -70,22 +251,24 @@ import { Application, Router, config } from "@shaferllc/keel/core";
70
251
  ```
71
252
 
72
253
  You supply the four convention folders yourself — `app/`, `config/`, `routes/`,
73
- `bootstrap/` — plus an entry that calls `createApplication()`. The starter's
254
+ `bootstrap/` — plus an entry that calls `createApplication()`. A generated kit’s
74
255
  `bootstrap/app.ts` is the reference; copy it and trim to taste.
75
256
 
76
257
  ### Hacking on the framework itself
77
258
 
78
- To work on Keel proper, clone the framework repo — it carries an example app you
79
- can run directly:
259
+ To work on Keel proper, clone the framework repo:
80
260
 
81
261
  ```bash
82
262
  git clone https://github.com/shaferllc/keel.git
83
263
  cd keel
84
264
  npm install
85
- npm run dev # example app on http://localhost:3000
86
- npm run build # compile the package to dist/
265
+ npm test
266
+ npm run typecheck
87
267
  ```
88
268
 
269
+ Generate a disposable app against your checkout with
270
+ `npm create keeljs@latest …` and point its dependency at `file:../keel`.
271
+
89
272
  ## Run the server
90
273
 
91
274
  ```bash
@@ -280,9 +463,10 @@ unsure what's mounted. [The Console](./console.md) lists every command.
280
463
  ## Where to go next
281
464
 
282
465
  You now have the shape of a Keel app: routes point at controllers, controllers
283
- render views and read config, and the console scaffolds the pieces. The deep
284
- guides pick up from here:
466
+ render views and read config, and the console scaffolds the pieces.
285
467
 
468
+ - **[From install to deploy](./from-install-to-deploy.md)** — presets, Cloudflare,
469
+ optional Keel Cloud + MCP
286
470
  - [Architecture](./architecture.md) — how boot, the container, and the request
287
471
  lifecycle fit together
288
472
  - [The Service Container](./container.md) — how dependency injection works
@@ -297,6 +481,7 @@ guides pick up from here:
297
481
  the active-record layer on top of it
298
482
  - [Configuration](./configuration.md) and [The Console](./console.md) — settings
299
483
  and commands
484
+ - [Building with AI](./ai.md) — MCP docs + Cloud tools
300
485
 
301
486
  When something isn't documented, open the source — the whole framework is a few
302
487
  hundred readable lines in `src/core/`, and [Built on Hono](./hono.md) explains
@@ -304,6 +489,116 @@ what you inherit from the layer underneath.
304
489
 
305
490
 
306
491
 
492
+ ---
493
+
494
+ <!-- source: docs/starter-kits.md -->
495
+
496
+ # Starter kits
497
+
498
+ ```bash
499
+ npm create keeljs@latest my-app -- --preset saas
500
+ ```
501
+
502
+ Four curated applications. Each is a complete, working app — not a scaffold you have
503
+ to finish. For the full path from this command through Cloudflare or Keel Cloud,
504
+ see [From install to deploy](./from-install-to-deploy.md).
505
+
506
+ | Preset | What you get |
507
+ | --- | --- |
508
+ | `minimal` | Routes, a controller, a JSX view, Tailwind. No database. |
509
+ | `api` | JSON only — models, migrations, validation, tests. No views. |
510
+ | `app` *(default)* | Full-stack: views, sessions, register/login, password reset, two-factor. |
511
+ | `saas` | `app` plus teams, roles, invitations, billing, and multi-tenancy. |
512
+
513
+ ## Pick a kit
514
+
515
+ ```bash
516
+ npm create keeljs@latest my-app # app (default)
517
+ npm create keeljs@latest my-api -- --preset api
518
+ npm create keeljs@latest my-saas -- --preset saas
519
+ npm create keeljs@latest bare -- --preset minimal
520
+ cd my-app && npm install && npm run dev
521
+ ```
522
+
523
+ Then open `http://localhost:3000`. The SaaS kit already has a team switcher,
524
+ invites, and a billing stub wired through [teams](./teams.md) and
525
+ [billing](./billing.md) — start by editing `app/Models` and `routes/web.ts`.
526
+
527
+ ## Every database, Cloudflare first
528
+
529
+ Each kit ships with all four drivers wired. Switching is `DB_CONNECTION` and nothing
530
+ else — no model or query changes, because they talk to a `Connection`, not a driver.
531
+
532
+ | | |
533
+ | --- | --- |
534
+ | **D1** | The default for deploys. Inside the Worker Keel uses the binding; migrations and scripts reach the same database over [the HTTP API](./database.md), so `keel migrate` works from your laptop and from CI. |
535
+ | **SQLite** (libSQL) | A local file. What `npm run dev` uses — no account, no wrangler. |
536
+ | **Turso** | libSQL over the network. |
537
+ | **Postgres** | For when you want it. |
538
+
539
+ Local and production are both SQLite dialects, so one schema and one set of
540
+ migrations serve both.
541
+
542
+ ```bash
543
+ npm run dev # Node, SQLite file, no setup
544
+ npm run dev:edge # wrangler, local D1
545
+ npm run deploy # wrangler deploy
546
+ ```
547
+
548
+ To deploy:
549
+
550
+ ```bash
551
+ wrangler d1 create my-app # paste the id into wrangler.jsonc
552
+ npm run deploy
553
+ ```
554
+
555
+ ## What's in the box
556
+
557
+ `app` and `saas` mount [accounts](./accounts.md), so password reset, email
558
+ verification, and two-factor already work — the flows live in the framework, tested
559
+ once, rather than being copy-pasted into each new app. `saas` also mounts
560
+ [teams](./teams.md) and [billing](./billing.md).
561
+
562
+ In `saas`, a tenant-owned model is one word:
563
+
564
+ ```ts
565
+ import { TenantModel } from "@shaferllc/keel/teams";
566
+
567
+ class Project extends TenantModel {
568
+ static table = "projects";
569
+ }
570
+
571
+ await Project.all(); // only the current team's. Always.
572
+ await Project.create({ name: "Hi" }); // stamped with the current team
573
+ ```
574
+
575
+ Another team's project isn't merely hidden from a list — `Project.find(id)` returns
576
+ `null`. You never write `.where("team_id", …)`, which is what makes it impossible to
577
+ forget.
578
+
579
+ ## Why a generator, and not a template repo
580
+
581
+ Because a second repo rots. The old starter sat pinned to `0.78.2` while the
582
+ framework was on `0.79.0`, and nothing noticed.
583
+
584
+ The templates live **inside the framework package**, so the version a kit is
585
+ generated from is, by construction, the version it was written for. And CI generates
586
+ all four on every push, then typechecks, migrates, boots, serves a request, bundles
587
+ the Worker, and runs their tests — so a breaking change fails in the pull request
588
+ that caused it, not in your `npm create` three weeks later.
589
+
590
+ ## The Node/edge seam
591
+
592
+ Each kit has two provider lists. `bootstrap/providers.ts` runs under Node;
593
+ `bootstrap/providers.edge.ts` runs in the Worker and deliberately **omits the
594
+ database provider** — it reaches for `pg`, which needs `net`/`tls`, and wrangler
595
+ cannot bundle a TCP driver for the edge. `worker.ts` binds D1 before the app boots,
596
+ so nothing on the edge needs to open a connection.
597
+
598
+ If you add a provider that touches a Node-only module, add it to the Node list only.
599
+
600
+
601
+
307
602
  ---
308
603
 
309
604
  <!-- source: docs/architecture.md -->
@@ -4669,8 +4964,9 @@ AI-facing surface: an MCP server, machine-readable docs (`llms.txt` /
4669
4964
  `llms-full.txt`), an agent playbook (`AGENTS.md`), and code generators an agent
4670
4965
  can drive directly.
4671
4966
 
4672
- If you only read one thing: point your agent at the [MCP server](#the-mcp-server)
4673
- and have it call `keel_overview` first.
4967
+ If you only read one thing: follow
4968
+ [From install to deploy](./from-install-to-deploy.md), then point your agent at
4969
+ the [MCP server](#the-mcp-server) and have it call `keel_overview` first.
4674
4970
 
4675
4971
  ## Why this exists
4676
4972
 
@@ -17957,115 +18253,6 @@ const gitlab = social.driver(
17957
18253
 
17958
18254
 
17959
18255
 
17960
- ---
17961
-
17962
- <!-- source: docs/starter-kits.md -->
17963
-
17964
- # Starter kits
17965
-
17966
- ```bash
17967
- npm create keeljs@latest my-app -- --preset saas
17968
- ```
17969
-
17970
- Four curated applications. Each is a complete, working app — not a scaffold you have
17971
- to finish.
17972
-
17973
- | Preset | What you get |
17974
- | --- | --- |
17975
- | `minimal` | Routes, a controller, a JSX view, Tailwind. No database. |
17976
- | `api` | JSON only — models, migrations, validation, tests. No views. |
17977
- | `app` *(default)* | Full-stack: views, sessions, register/login, password reset, two-factor. |
17978
- | `saas` | `app` plus teams, roles, invitations, billing, and multi-tenancy. |
17979
-
17980
- ## Pick a kit
17981
-
17982
- ```bash
17983
- npm create keeljs@latest my-app # app (default)
17984
- npm create keeljs@latest my-api -- --preset api
17985
- npm create keeljs@latest my-saas -- --preset saas
17986
- npm create keeljs@latest bare -- --preset minimal
17987
- cd my-app && npm install && npm run dev
17988
- ```
17989
-
17990
- Then open `http://localhost:3000`. The SaaS kit already has a team switcher,
17991
- invites, and a billing stub wired through [teams](./teams.md) and
17992
- [billing](./billing.md) — start by editing `app/Models` and `routes/web.ts`.
17993
-
17994
- ## Every database, Cloudflare first
17995
-
17996
- Each kit ships with all four drivers wired. Switching is `DB_CONNECTION` and nothing
17997
- else — no model or query changes, because they talk to a `Connection`, not a driver.
17998
-
17999
- | | |
18000
- | --- | --- |
18001
- | **D1** | The default for deploys. Inside the Worker Keel uses the binding; migrations and scripts reach the same database over [the HTTP API](./database.md), so `keel migrate` works from your laptop and from CI. |
18002
- | **SQLite** (libSQL) | A local file. What `npm run dev` uses — no account, no wrangler. |
18003
- | **Turso** | libSQL over the network. |
18004
- | **Postgres** | For when you want it. |
18005
-
18006
- Local and production are both SQLite dialects, so one schema and one set of
18007
- migrations serve both.
18008
-
18009
- ```bash
18010
- npm run dev # Node, SQLite file, no setup
18011
- npm run dev:edge # wrangler, local D1
18012
- npm run deploy # wrangler deploy
18013
- ```
18014
-
18015
- To deploy:
18016
-
18017
- ```bash
18018
- wrangler d1 create my-app # paste the id into wrangler.jsonc
18019
- npm run deploy
18020
- ```
18021
-
18022
- ## What's in the box
18023
-
18024
- `app` and `saas` mount [accounts](./accounts.md), so password reset, email
18025
- verification, and two-factor already work — the flows live in the framework, tested
18026
- once, rather than being copy-pasted into each new app. `saas` also mounts
18027
- [teams](./teams.md) and [billing](./billing.md).
18028
-
18029
- In `saas`, a tenant-owned model is one word:
18030
-
18031
- ```ts
18032
- import { TenantModel } from "@shaferllc/keel/teams";
18033
-
18034
- class Project extends TenantModel {
18035
- static table = "projects";
18036
- }
18037
-
18038
- await Project.all(); // only the current team's. Always.
18039
- await Project.create({ name: "Hi" }); // stamped with the current team
18040
- ```
18041
-
18042
- Another team's project isn't merely hidden from a list — `Project.find(id)` returns
18043
- `null`. You never write `.where("team_id", …)`, which is what makes it impossible to
18044
- forget.
18045
-
18046
- ## Why a generator, and not a template repo
18047
-
18048
- Because a second repo rots. The old starter sat pinned to `0.78.2` while the
18049
- framework was on `0.79.0`, and nothing noticed.
18050
-
18051
- The templates live **inside the framework package**, so the version a kit is
18052
- generated from is, by construction, the version it was written for. And CI generates
18053
- all four on every push, then typechecks, migrates, boots, serves a request, bundles
18054
- the Worker, and runs their tests — so a breaking change fails in the pull request
18055
- that caused it, not in your `npm create` three weeks later.
18056
-
18057
- ## The Node/edge seam
18058
-
18059
- Each kit has two provider lists. `bootstrap/providers.ts` runs under Node;
18060
- `bootstrap/providers.edge.ts` runs in the Worker and deliberately **omits the
18061
- database provider** — it reaches for `pg`, which needs `net`/`tls`, and wrangler
18062
- cannot bundle a TCP driver for the edge. `worker.ts` binds D1 before the app boots,
18063
- so nothing on the edge needs to open a connection.
18064
-
18065
- If you add a provider that touches a Node-only module, add it to the Node list only.
18066
-
18067
-
18068
-
18069
18256
  ---
18070
18257
 
18071
18258
  <!-- source: docs/static-files.md -->
package/llms.txt CHANGED
@@ -30,6 +30,7 @@ Userland imports everything from `@shaferllc/keel/core`.
30
30
  - [Errors & Exceptions](https://github.com/shaferllc/keel/blob/main/docs/errors.md): Throw an exception anywhere — a handler, middleware, or a service deep in the container — and Keel's HTTP kernel turns it into the right response.
31
31
  - [Events](https://github.com/shaferllc/keel/blob/main/docs/events.md): A tiny event emitter for decoupling — fire an event in one place, handle it in another.
32
32
  - [Factories & Seeders](https://github.com/shaferllc/keel/blob/main/docs/factories.md): Populate the database with realistic fixtures for tests and demos.
33
+ - [From install to deploy](https://github.com/shaferllc/keel/blob/main/docs/from-install-to-deploy.md): One path from zero to a live Keel app — locally, on Cloudflare yourself, or on Keel Cloud with an AI agent.
33
34
  - [Gates](https://github.com/shaferllc/keel/blob/main/docs/gates.md): Keel Gates is a signup gate for private alpha / waitlist apps: an email allowlist, invite codes with use limits and expiry, and a single check that answers "may this person register?".
34
35
  - [Getting Started](https://github.com/shaferllc/keel/blob/main/docs/getting-started.md): Keel is a house framework for Node.js — a small, legible MVC layer over Hono.
35
36
  - [Hashing & Encryption](https://github.com/shaferllc/keel/blob/main/docs/hashing.md): Password hashing and value encryption, both built on the Web Crypto API — so they run identically on Node and the edge, with no native bindings (no bcrypt to compile).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaferllc/keel",
3
- "version": "0.83.5",
3
+ "version": "0.83.6",
4
4
  "type": "module",
5
5
  "description": "The house framework for Node.js — a service container, providers, routing, JSX views, and a code-generating console.",
6
6
  "license": "MIT",