create-creek-app 0.1.0 → 0.2.0

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 ADDED
@@ -0,0 +1,136 @@
1
+ # create-creek-app — Agent Reference
2
+
3
+ You are interacting with `create-creek-app`, a CLI that scaffolds Creek projects from templates. Creek deploys to Cloudflare Workers.
4
+
5
+ ## Capabilities
6
+
7
+ - Scaffold a new project from a built-in or third-party template
8
+ - Discover available templates and their schemas (JSON output)
9
+ - Validate template parameters before scaffolding
10
+ - Customize templates via JSON data (inline or file)
11
+
12
+ ## Command Reference
13
+
14
+ All commands output JSON to **stdout**. Progress/errors go to **stderr**.
15
+
16
+ ### Discovery (read-only, no side effects)
17
+
18
+ ```bash
19
+ npx create-creek-app --list
20
+ ```
21
+ Returns JSON array to stdout:
22
+ ```json
23
+ [
24
+ { "name": "blank", "description": "Minimal Creek project (no UI)", "capabilities": [] },
25
+ { "name": "landing", "description": "Landing page with hero and CTA", "capabilities": [] },
26
+ { "name": "blog", "description": "Blog with posts (D1 database)", "capabilities": ["d1"] }
27
+ ]
28
+ ```
29
+
30
+ ```bash
31
+ npx create-creek-app --template landing --schema
32
+ ```
33
+ Returns the template's JSON Schema to stdout:
34
+ ```json
35
+ {
36
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
37
+ "type": "object",
38
+ "properties": {
39
+ "title": { "type": "string", "default": "My Product" },
40
+ "theme": { "type": "string", "enum": ["light", "dark"], "default": "dark" }
41
+ }
42
+ }
43
+ ```
44
+
45
+ ```bash
46
+ npx create-creek-app --template landing --validate --data '{"theme":"dark"}'
47
+ ```
48
+ Returns validation result to stdout:
49
+ ```json
50
+ { "valid": true, "errors": [] }
51
+ ```
52
+ On failure:
53
+ ```json
54
+ { "valid": false, "errors": [{ "path": "/theme", "message": "must be equal to one of the allowed values" }] }
55
+ ```
56
+
57
+ ### Scaffold (creates files)
58
+
59
+ ```bash
60
+ # Non-interactive scaffold
61
+ npx create-creek-app <dir> --template <name> --yes
62
+
63
+ # With custom parameters
64
+ npx create-creek-app <dir> --template <name> --data '<json>' --yes
65
+
66
+ # From a JSON config file
67
+ npx create-creek-app <dir> --template <name> --data-file <path> --yes
68
+
69
+ # Skip install and git init (faster, useful for testing)
70
+ npx create-creek-app <dir> --template <name> --yes --no-install --no-git
71
+
72
+ # Third-party template from GitHub
73
+ npx create-creek-app <dir> --template github:user/repo --yes
74
+ ```
75
+
76
+ ### Deploy (after scaffolding)
77
+
78
+ ```bash
79
+ cd <dir> && npx creek deploy --yes
80
+ ```
81
+
82
+ ## Recommended Workflow
83
+
84
+ 1. **`--list`** → pick a template based on description and capabilities
85
+ 2. **`--schema`** → read the JSON Schema to know valid parameters
86
+ 3. **`--validate`** → check your generated data (optional, scaffold validates too)
87
+ 4. **Scaffold** with `--template`, `--data`, `--yes`
88
+ 5. **Deploy** with `npx creek deploy --yes`
89
+
90
+ ## Exit Codes
91
+
92
+ | Code | Meaning |
93
+ |------|---------|
94
+ | `0` | Success |
95
+ | `1` | Error (validation failure, bad arguments, network error) |
96
+
97
+ ## Available Templates
98
+
99
+ | Name | Capabilities | Use when |
100
+ |------|-------------|----------|
101
+ | `blank` | — | Agent generates all code from scratch |
102
+ | `landing` | — | Marketing/product landing page |
103
+ | `blog` | D1 | Content site with database |
104
+ | `link-in-bio` | — | Social links page |
105
+ | `api` | D1 | REST API backend |
106
+ | `todo` | D1, Realtime | Full-stack app with WebSocket |
107
+ | `dashboard` | D1, Realtime | Data visualization with live updates |
108
+ | `form` | D1 | Form submissions with database storage |
109
+ | `chatbot` | D1, AI | AI-powered chat with conversation history |
110
+
111
+ ## Template Parameters
112
+
113
+ Parameters are template-specific. Always run `--schema` to discover them. Common patterns:
114
+
115
+ - `name` — project name (auto-populated from directory name)
116
+ - `title`, `tagline`, `description` — display text
117
+ - `theme` — typically `"light"` or `"dark"` (enum-constrained)
118
+ - `accentColor` — hex color string
119
+ - `features` — array of `{ title, description }` objects
120
+
121
+ ## What Creek Provides After Deploy
122
+
123
+ The scaffolded project deploys to Cloudflare's edge network via `creek deploy`. Depending on template capabilities:
124
+
125
+ - **All templates**: Global CDN, HTTPS, preview URLs
126
+ - **D1**: SQLite database — use `import { db } from "creek"` (no connection strings)
127
+ - **Realtime**: WebSocket — use `import { usePresence } from "creek/react"`
128
+ - **AI**: Workers AI — use `import { ai } from "creek"`
129
+
130
+ ## Important Notes
131
+
132
+ - Always use `--yes` to skip interactive prompts
133
+ - The `--data` flag accepts inline JSON; use `--data-file` for complex data
134
+ - Templates use runtime config (`creek-data.json`) — users can customize after scaffold by editing this file
135
+ - `creek-template.json` is metadata only — it's removed from the scaffolded project
136
+ - No API keys or credentials needed for scaffolding; `creek deploy` handles auth via OAuth
package/README.md CHANGED
@@ -1,11 +1,44 @@
1
1
  # create-creek-app
2
2
 
3
- Scaffold a new [Creek](https://creek.dev) project from a template.
3
+ [![npm version](https://img.shields.io/npm/v/create-creek-app)](https://www.npmjs.com/package/create-creek-app)
4
+ [![license](https://img.shields.io/npm/l/create-creek-app)](https://github.com/solcreek/creek/blob/main/LICENSE)
5
+
6
+ Scaffold a new [Creek](https://creek.dev) project from a template — deploy to the edge in two commands.
7
+
8
+ ## What is Creek?
9
+
10
+ Creek is a deployment platform built on [Cloudflare Workers](https://developers.cloudflare.com/workers/). It replaces the manual setup of `wrangler.toml`, bindings, and resource provisioning with a single `creek.toml` config and zero-config CLI.
11
+
12
+ - **`creek.toml`** replaces `wrangler.toml` — Creek manages Workers, routes, and bindings for you
13
+ - **`creek deploy`** replaces `wrangler deploy` — one command provisions D1 databases, KV namespaces, R2 buckets, and deploys your code
14
+ - **You own the Cloudflare account** — Creek deploys to your CF account via OAuth, no vendor lock-in
15
+
16
+ If you already use Wrangler, Creek is a higher-level abstraction. If you're new to Cloudflare, Creek is the fastest way to get started.
17
+
18
+ ## Prerequisites
19
+
20
+ - **Node.js 18+** (LTS recommended)
21
+ - **Cloudflare account** — free tier works. Not needed for scaffolding, only for `creek deploy` (you'll be prompted to sign in via OAuth on first deploy)
22
+
23
+ > **`creek` vs `create-creek-app`**: `create-creek-app` scaffolds a new project. `creek` is the CLI that deploys, runs dev server, and manages your project. Both are installed on-demand via `npx`.
24
+
25
+ ## Quick Start
4
26
 
5
27
  ```bash
6
- npx create-creek-app
28
+ # 1. Scaffold a landing page
29
+ npx create-creek-app my-site --template landing --yes
30
+
31
+ # 2. Local development
32
+ cd my-site && npx creek dev
33
+ # → http://localhost:5173 with hot reload
34
+
35
+ # 3. Deploy to production
36
+ npx creek deploy
37
+ # → https://my-site-your-team.bycreek.com (live in ~10 seconds)
7
38
  ```
8
39
 
40
+ You get a globally distributed site on Cloudflare's edge network, with optional D1 database, KV storage, R2 files, AI inference, and Realtime WebSockets — all managed by Creek.
41
+
9
42
  ## Usage
10
43
 
11
44
  ### Interactive (human)
@@ -21,17 +54,61 @@ npx create-creek-app
21
54
  npx create-creek-app my-blog --template blog --data '{"name":"Alice"}' --yes
22
55
  ```
23
56
 
57
+ ### From a JSON config file
58
+
59
+ ```bash
60
+ npx create-creek-app my-site --template landing --data-file config.json --yes
61
+ ```
62
+
63
+ ```json
64
+ // config.json
65
+ {
66
+ "title": "Acme Corp",
67
+ "tagline": "The best widgets",
68
+ "theme": "light",
69
+ "features": [
70
+ { "title": "Fast", "description": "Edge-powered performance" },
71
+ { "title": "Secure", "description": "Built-in DDoS protection" }
72
+ ]
73
+ }
74
+ ```
75
+
24
76
  ### Template discovery
25
77
 
26
78
  ```bash
27
- # List all templates (JSON)
79
+ # List all templates
28
80
  npx create-creek-app --list
81
+ ```
29
82
 
83
+ ```json
84
+ [
85
+ { "name": "blank", "description": "Minimal Creek project (no UI)", "capabilities": [] },
86
+ { "name": "landing", "description": "Landing page with hero and CTA", "capabilities": [] },
87
+ { "name": "blog", "description": "Blog with posts (D1 database)", "capabilities": ["d1"] },
88
+ ...
89
+ ]
90
+ ```
91
+
92
+ ```bash
30
93
  # Print a template's JSON Schema
31
94
  npx create-creek-app --template landing --schema
95
+ ```
32
96
 
97
+ ```json
98
+ {
99
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
100
+ "type": "object",
101
+ "properties": {
102
+ "title": { "type": "string", "default": "My Product" },
103
+ "theme": { "type": "string", "enum": ["light", "dark"], "default": "dark" }
104
+ }
105
+ }
106
+ ```
107
+
108
+ ```bash
33
109
  # Validate data before scaffolding
34
110
  npx create-creek-app --template landing --validate --data '{"theme":"dark"}'
111
+ # → { "valid": true, "errors": [] }
35
112
  ```
36
113
 
37
114
  ### Third-party templates
@@ -45,7 +122,7 @@ npx create-creek-app --template github:user/my-template
45
122
  ```
46
123
  npx create-creek-app [dir] [options]
47
124
 
48
- dir Project directory (default: prompted or "my-creek-app")
125
+ dir Project directory (default: prompted or "my-creek-app")
49
126
 
50
127
  -t, --template <name|github:user/repo> Template to use
51
128
  --data <json> JSON data for template params
@@ -61,17 +138,24 @@ npx create-creek-app [dir] [options]
61
138
 
62
139
  ## Templates
63
140
 
141
+ Each template is a complete, deployable project — not a skeleton. Capabilities indicate which Creek-managed resources are pre-configured:
142
+
64
143
  | Template | Description | Capabilities |
65
144
  |----------|-------------|-------------|
66
145
  | `blank` | Minimal Creek project (no UI) | — |
67
146
  | `landing` | Landing page with hero and CTA | — |
68
- | `blog` | Blog with posts | D1 |
147
+ | `blog` | Blog with posts | D1 database |
69
148
  | `link-in-bio` | Social links page | — |
70
- | `api` | REST API with Hono | D1 |
71
- | `todo` | Realtime todo app | D1, Realtime |
72
- | `dashboard` | Data dashboard | D1, Realtime |
73
- | `form` | Form collector | D1 |
74
- | `chatbot` | AI chatbot | D1, AI |
149
+ | `api` | REST API with Hono | D1 database |
150
+ | `todo` | Realtime todo app | D1 + WebSocket |
151
+ | `dashboard` | Data dashboard | D1 + WebSocket |
152
+ | `form` | Form collector | D1 database |
153
+ | `chatbot` | AI chatbot | D1 + Workers AI |
154
+
155
+ **Capabilities explained:**
156
+ - **D1** — SQLite database at the edge, managed by Creek (no connection strings, no migrations)
157
+ - **Realtime** — WebSocket connections via Creek's Realtime service (presence, broadcast)
158
+ - **AI** — Inference via Cloudflare Workers AI (LLMs, embeddings, image generation)
75
159
 
76
160
  ## Template Schema
77
161
 
@@ -84,8 +168,6 @@ Each template defines customizable parameters via [JSON Schema](https://json-sch
84
168
  "name": "landing",
85
169
  "description": "Landing page with hero, features, and CTA",
86
170
  "capabilities": [],
87
- "thumbnail": "thumbnail.png",
88
- "screenshot": "screenshot.png",
89
171
  "schema": {
90
172
  "$schema": "https://json-schema.org/draft/2020-12/schema",
91
173
  "type": "object",
@@ -108,14 +190,14 @@ Each template defines customizable parameters via [JSON Schema](https://json-sch
108
190
  |-------|------|----------|-------------|
109
191
  | `name` | string | yes | Template identifier |
110
192
  | `description` | string | yes | Short description |
111
- | `capabilities` | string[] | yes | Required Creek resources: `d1`, `kv`, `r2`, `ai`, `realtime` |
112
- | `thumbnail` | string | no | Relative path to thumbnail image (400x300 recommended) |
113
- | `screenshot` | string | no | Relative path to full screenshot image |
193
+ | `capabilities` | string[] | yes | Creek resources used: `d1`, `kv`, `r2`, `ai`, `realtime` |
194
+ | `thumbnail` | string | no | Path or URL to thumbnail image (400x300 recommended) |
195
+ | `screenshot` | string | no | Path or URL to full screenshot image |
114
196
  | `schema` | object | no | JSON Schema defining customizable parameters |
115
197
 
116
198
  ### creek-data.json
117
199
 
118
- Default values for the schema parameters. The app reads this file at runtime — no build-time string replacement.
200
+ Default values for the schema parameters. Your app reads this file at runtime — no build-time string replacement. Users customize their project by editing this one file.
119
201
 
120
202
  ```json
121
203
  {
@@ -125,6 +207,15 @@ Default values for the schema parameters. The app reads this file at runtime —
125
207
  }
126
208
  ```
127
209
 
210
+ ```tsx
211
+ // src/App.tsx — reads config at runtime
212
+ import data from "../creek-data.json";
213
+
214
+ export function App() {
215
+ return <h1>{data.title}</h1>;
216
+ }
217
+ ```
218
+
128
219
  ## Validation
129
220
 
130
221
  Data is validated against the template's JSON Schema using [ajv](https://ajv.js.org/). Validation runs automatically during scaffold and can be triggered independently with `--validate`.
@@ -141,19 +232,24 @@ Data is validated against the template's JSON Schema using [ajv](https://ajv.js.
141
232
  ### Validation examples
142
233
 
143
234
  ```bash
144
- # Valid — passes
235
+ # Valid — passes (exit code 0)
145
236
  npx create-creek-app --template landing --validate --data '{"theme":"dark"}'
146
237
  # → { "valid": true, "errors": [] }
147
238
 
148
- # Invalid enum — fails
239
+ # Invalid enum — fails (exit code 1)
149
240
  npx create-creek-app --template landing --validate --data '{"theme":"invalid"}'
150
241
  # → { "valid": false, "errors": [{ "path": "/theme", "message": "must be equal to one of the allowed values" }] }
151
-
152
- # Wrong type — fails
153
- npx create-creek-app --template landing --validate --data '{"title":123}'
154
- # → { "valid": false, "errors": [{ "path": "/title", "message": "must be string" }] }
155
242
  ```
156
243
 
244
+ ## Exit Codes
245
+
246
+ | Code | Meaning |
247
+ |------|---------|
248
+ | `0` | Success |
249
+ | `1` | Error — validation failure, invalid arguments, scaffold failure, or network error |
250
+
251
+ All structured output (`--list`, `--schema`, `--validate`) goes to **stdout** as JSON. Progress messages and errors go to **stderr**.
252
+
157
253
  ## Creating Custom Templates
158
254
 
159
255
  A Creek template is a directory with at minimum a `package.json` and `creek.toml`. Add `creek-template.json` for schema-driven customization.
@@ -162,25 +258,22 @@ A Creek template is a directory with at minimum a `package.json` and `creek.toml
162
258
 
163
259
  ```
164
260
  my-template/
165
- ├── creek-template.json ← schema + metadata (optional)
261
+ ├── creek-template.json ← schema + metadata (removed on scaffold)
166
262
  ├── creek-data.json ← default values (optional)
167
263
  ├── creek.toml ← Creek project config
168
264
  ├── package.json
169
265
  ├── src/ ← your code
170
266
  ├── worker/index.ts ← edge worker (if needed)
171
- └── _gitignore ← renamed to .gitignore on scaffold
267
+ └── .gitignore
172
268
  ```
173
269
 
174
270
  ### Best practices
175
271
 
176
- 1. **Use JSON Schema defaults** — every property in the schema should have a `default` so the template works without any `--data`
177
- 2. **Read config at runtime** — import `creek-data.json` in your code instead of using build-time placeholders. This lets users customize after scaffold by editing one file
178
- 3. **Keep schemas flat** — prefer top-level string/number/boolean properties. Use arrays only for naturally repeated structures (e.g., feature lists)
179
- 4. **Use `enum` for constrained choices** — themes, layouts, color schemes. Agents can discover valid options via `--schema`
180
- 5. **Name the `name` property** — include a `name` property in your schema. `create-creek-app` auto-populates it from the project directory
181
- 6. **Add a thumbnail** — 400x300 PNG for template gallery display. Optional, but recommended for visual templates
182
- 7. **Add a screenshot** — full-page screenshot showing the template in action. Optional
183
- 8. **Use `_gitignore`** — npm strips `.gitignore` from published packages. Use `_gitignore` and it will be renamed automatically
272
+ 1. **Use JSON Schema defaults** — every property should have a `default` so the template works without any `--data`
273
+ 2. **Read config at runtime** — import `creek-data.json` in your code instead of build-time placeholders
274
+ 3. **Keep schemas flat** — prefer top-level string/number/boolean properties
275
+ 4. **Use `enum` for constrained choices** — themes, layouts, color schemes. Agents discover valid options via `--schema`
276
+ 5. **Include a `name` property** — `create-creek-app` auto-populates it from the project directory
184
277
 
185
278
  ### Publishing
186
279
 
@@ -199,21 +292,61 @@ Or submit it to the [Creek template gallery](https://github.com/solcreek/templat
199
292
  ```bash
200
293
  # 1. Discover templates
201
294
  npx create-creek-app --list
295
+ # → JSON array to stdout
202
296
 
203
297
  # 2. Read schema for chosen template
204
298
  npx create-creek-app --template landing --schema
299
+ # → JSON Schema to stdout
205
300
 
206
301
  # 3. Validate generated data
207
302
  npx create-creek-app --template landing --validate --data '{"title":"Acme","theme":"dark"}'
303
+ # → { "valid": true, "errors": [] }
208
304
 
209
305
  # 4. Scaffold
210
306
  npx create-creek-app my-site --template landing --data '{"title":"Acme"}' --yes
211
307
 
212
308
  # 5. Deploy
213
- cd my-site && npx creek deploy
309
+ cd my-site && npx creek deploy --yes
310
+ # → { "ok": true, "url": "https://my-site-team.bycreek.com", ... }
214
311
  ```
215
312
 
216
- All discovery and validation commands output JSON to stdout for programmatic consumption.
313
+ All discovery and validation commands output JSON to stdout for programmatic consumption. Use `--yes` to skip all interactive prompts.
314
+
315
+ ## Contributing Templates
316
+
317
+ The template ecosystem is open to everyone. We welcome contributions from individual developers, agencies, and framework authors.
318
+
319
+ ### How to submit
320
+
321
+ 1. Fork [solcreek/templates](https://github.com/solcreek/templates)
322
+ 2. Create your template directory following the [template structure](#template-structure)
323
+ 3. Ensure it scaffolds and deploys cleanly: `npx create-creek-app test-dir --template ./your-template --yes && cd test-dir && creek deploy`
324
+ 4. Open a pull request
325
+
326
+ ### Acceptance criteria
327
+
328
+ - **Works out of the box** — `--yes` with no `--data` must produce a deployable project
329
+ - **Has `creek-template.json`** — with description, capabilities, and schema (if customizable)
330
+ - **No secrets or API keys** — templates must not require external service credentials to scaffold
331
+ - **English** — template names, descriptions, and code comments in English
332
+
333
+ ### Template tiers
334
+
335
+ | Tier | Badge | Maintained by | Review |
336
+ |------|-------|--------------|--------|
337
+ | **Official** | `solcreek/templates` | Creek team | Creek team review |
338
+ | **Community** | `github:author/repo` | Author | Self-published, no review required |
339
+
340
+ Official templates are held to a higher standard: they must stay compatible with the latest Creek CLI and are tested in CI. Community templates can be used by anyone via `--template github:author/repo` — no approval process needed.
341
+
342
+ ### Ideas for templates
343
+
344
+ We'd especially love to see:
345
+ - Framework-specific starters (Astro + Creek, SvelteKit + Creek)
346
+ - Industry verticals (restaurant menu, event page, portfolio)
347
+ - Backend patterns (webhook receiver, cron job, queue processor)
348
+
349
+ See the [templates repo](https://github.com/solcreek/templates) for the full contribution guide.
217
350
 
218
351
  ## License
219
352
 
package/dist/scaffold.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolve, basename } from "node:path";
2
- import { existsSync, renameSync, unlinkSync } from "node:fs";
2
+ import { existsSync, unlinkSync } from "node:fs";
3
3
  import { execSync } from "node:child_process";
4
4
  import consola from "consola";
5
5
  import { fetchTemplate } from "./fetch.js";
@@ -26,13 +26,7 @@ export async function scaffold(opts) {
26
26
  }
27
27
  // 3. Apply data
28
28
  applyData(dir, userData, defaultData);
29
- // 4. Rename _gitignore .gitignore
30
- const gitignoreSrc = resolve(dir, "_gitignore");
31
- const gitignoreDest = resolve(dir, ".gitignore");
32
- if (existsSync(gitignoreSrc)) {
33
- renameSync(gitignoreSrc, gitignoreDest);
34
- }
35
- // 5. Remove creek-template.json from output (metadata, not project file)
29
+ // 4. Remove creek-template.json from output (metadata, not project file)
36
30
  const templateConfigPath = resolve(dir, "creek-template.json");
37
31
  if (existsSync(templateConfigPath)) {
38
32
  unlinkSync(templateConfigPath);
@@ -1,39 +1,19 @@
1
- /** Hardcoded template list — used for --list and interactive prompt. */
2
- export declare const TEMPLATES: readonly [{
3
- readonly name: "blank";
4
- readonly description: "Minimal Creek project (no UI)";
5
- readonly capabilities: string[];
6
- }, {
7
- readonly name: "landing";
8
- readonly description: "Landing page with hero and CTA";
9
- readonly capabilities: string[];
10
- }, {
11
- readonly name: "blog";
12
- readonly description: "Blog with posts (D1 database)";
13
- readonly capabilities: readonly ["d1"];
14
- }, {
15
- readonly name: "link-in-bio";
16
- readonly description: "Social links page";
17
- readonly capabilities: string[];
18
- }, {
19
- readonly name: "api";
20
- readonly description: "REST API with Hono (D1)";
21
- readonly capabilities: readonly ["d1"];
22
- }, {
23
- readonly name: "todo";
24
- readonly description: "Realtime todo app (D1 + WebSocket)";
25
- readonly capabilities: readonly ["d1", "realtime"];
26
- }, {
27
- readonly name: "dashboard";
28
- readonly description: "Data dashboard (D1 + Realtime)";
29
- readonly capabilities: readonly ["d1", "realtime"];
30
- }, {
31
- readonly name: "form";
32
- readonly description: "Form collector (D1)";
33
- readonly capabilities: readonly ["d1"];
34
- }, {
35
- readonly name: "chatbot";
36
- readonly description: "AI chatbot (D1 + Workers AI)";
37
- readonly capabilities: readonly ["d1", "ai"];
38
- }];
1
+ /**
2
+ * Template catalog used for --list, interactive prompt, and gallery.
3
+ *
4
+ * Four types by output:
5
+ * site — Visual pages (deploy → shareable URL)
6
+ * app — Interactive UI + backend logic
7
+ * workflow — Background process (no/minimal UI), trigger + steps
8
+ * connector Data bridge pattern (ingestion → storage)
9
+ */
10
+ export interface Template {
11
+ name: string;
12
+ description: string;
13
+ type: "site" | "app" | "workflow" | "connector" | "developer";
14
+ capabilities: string[];
15
+ trigger?: string;
16
+ }
17
+ export declare const TEMPLATES: Template[];
39
18
  export type TemplateName = (typeof TEMPLATES)[number]["name"];
19
+ export type TemplateType = Template["type"];
package/dist/templates.js CHANGED
@@ -1,12 +1,38 @@
1
- /** Hardcoded template list — used for --list and interactive prompt. */
1
+ /**
2
+ * Template catalog — used for --list, interactive prompt, and gallery.
3
+ *
4
+ * Four types by output:
5
+ * site — Visual pages (deploy → shareable URL)
6
+ * app — Interactive UI + backend logic
7
+ * workflow — Background process (no/minimal UI), trigger + steps
8
+ * connector — Data bridge pattern (ingestion → storage)
9
+ */
2
10
  export const TEMPLATES = [
3
- { name: "blank", description: "Minimal Creek project (no UI)", capabilities: [] },
4
- { name: "landing", description: "Landing page with hero and CTA", capabilities: [] },
5
- { name: "blog", description: "Blog with posts (D1 database)", capabilities: ["d1"] },
6
- { name: "link-in-bio", description: "Social links page", capabilities: [] },
7
- { name: "api", description: "REST API with Hono (D1)", capabilities: ["d1"] },
8
- { name: "todo", description: "Realtime todo app (D1 + WebSocket)", capabilities: ["d1", "realtime"] },
9
- { name: "dashboard", description: "Data dashboard (D1 + Realtime)", capabilities: ["d1", "realtime"] },
10
- { name: "form", description: "Form collector (D1)", capabilities: ["d1"] },
11
- { name: "chatbot", description: "AI chatbot (D1 + Workers AI)", capabilities: ["d1", "ai"] },
11
+ // --- Sites (Level 4 deploy shareable) ---
12
+ { name: "landing", description: "Landing page with hero and CTA", type: "site", capabilities: [] },
13
+ { name: "blog", description: "Blog with image uploads", type: "site", capabilities: ["database", "storage"] },
14
+ { name: "link-in-bio", description: "Social links page", type: "site", capabilities: [] },
15
+ { name: "waitlist", description: "Waitlist with AI user segmentation", type: "site", capabilities: ["database", "ai"] },
16
+ // --- Apps (Level 3 working data pipeline + UI) ---
17
+ { name: "form", description: "Form collector with admin dashboard", type: "app", capabilities: ["database"] },
18
+ { name: "dashboard", description: "Data dashboard with scheduled refresh", type: "app", capabilities: ["database", "realtime", "cron"] },
19
+ { name: "chatbot", description: "AI chatbot with conversation history", type: "app", capabilities: ["database", "ai"] },
20
+ { name: "survey", description: "Survey with AI-powered analysis", type: "app", capabilities: ["database", "ai"] },
21
+ { name: "knowledge-base", description: "Knowledge base with AI search", type: "app", capabilities: ["database", "ai", "storage"] },
22
+ { name: "status-page", description: "Service status page with uptime monitoring", type: "app", capabilities: ["database", "realtime", "cron", "cache"] },
23
+ { name: "file-share", description: "File upload/download with expiring links", type: "app", capabilities: ["database", "storage"] },
24
+ { name: "todo", description: "Realtime todo app (learning example)", type: "app", capabilities: ["database", "realtime"] },
25
+ // --- Workflows (Level 2-3 — trigger + steps, no/minimal UI) ---
26
+ { name: "approval-flow", description: "Approval workflow — leave, expense, procurement", type: "workflow", capabilities: ["database", "realtime", "queue"], trigger: "webhook" },
27
+ { name: "invoice-processor", description: "Email invoice → AI extract → DB → notify", type: "workflow", capabilities: ["database", "ai", "storage", "email"], trigger: "email" },
28
+ { name: "scheduled-report", description: "Scheduled query → AI summary → PDF report", type: "workflow", capabilities: ["database", "ai", "storage", "cron"], trigger: "cron" },
29
+ { name: "data-sync", description: "Scheduled API pull → diff → DB → notify", type: "workflow", capabilities: ["database", "cron"], trigger: "cron" },
30
+ { name: "ai-classifier", description: "Input → AI classify → route to queue", type: "workflow", capabilities: ["database", "ai", "queue"], trigger: "webhook" },
31
+ // --- Connectors (Level 2 — pure platform wiring) ---
32
+ { name: "api", description: "REST API with Hono", type: "connector", capabilities: ["database"], trigger: "http" },
33
+ { name: "webhook-receiver", description: "Receive and process external webhooks", type: "connector", capabilities: ["database", "queue"], trigger: "webhook" },
34
+ { name: "email-to-db", description: "Email → parse → attachments to R2 → DB", type: "connector", capabilities: ["database", "storage", "email"], trigger: "email" },
35
+ { name: "ftp-sync", description: "Scheduled FTP/SFTP pull → parse → DB", type: "connector", capabilities: ["database", "storage", "cron", "ftp"], trigger: "cron" },
36
+ // --- Developer ---
37
+ { name: "blank", description: "Minimal Creek project (empty canvas)", type: "developer", capabilities: [] },
12
38
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-creek-app",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Create a new Creek project from a template",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "main": "./dist/index.js",
10
10
  "files": [
11
- "dist"
11
+ "dist",
12
+ "AGENTS.md"
12
13
  ],
13
14
  "scripts": {
14
15
  "build": "tsc",