@quickback-dev/cli 0.9.5

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.
Files changed (122) hide show
  1. package/README.md +7 -0
  2. package/dist/commands/claude.d.ts +13 -0
  3. package/dist/commands/claude.d.ts.map +1 -0
  4. package/dist/commands/claude.js +305 -0
  5. package/dist/commands/claude.js.map +1 -0
  6. package/dist/commands/compile.d.ts +18 -0
  7. package/dist/commands/compile.d.ts.map +1 -0
  8. package/dist/commands/compile.js +326 -0
  9. package/dist/commands/compile.js.map +1 -0
  10. package/dist/commands/create.d.ts +18 -0
  11. package/dist/commands/create.d.ts.map +1 -0
  12. package/dist/commands/create.js +798 -0
  13. package/dist/commands/create.js.map +1 -0
  14. package/dist/commands/cursor.d.ts +11 -0
  15. package/dist/commands/cursor.d.ts.map +1 -0
  16. package/dist/commands/cursor.js +156 -0
  17. package/dist/commands/cursor.js.map +1 -0
  18. package/dist/commands/docs.d.ts +10 -0
  19. package/dist/commands/docs.d.ts.map +1 -0
  20. package/dist/commands/docs.js +93 -0
  21. package/dist/commands/docs.js.map +1 -0
  22. package/dist/commands/example.d.ts +7 -0
  23. package/dist/commands/example.d.ts.map +1 -0
  24. package/dist/commands/example.js +153 -0
  25. package/dist/commands/example.js.map +1 -0
  26. package/dist/commands/init.d.ts +6 -0
  27. package/dist/commands/init.d.ts.map +1 -0
  28. package/dist/commands/init.js +383 -0
  29. package/dist/commands/init.js.map +1 -0
  30. package/dist/commands/login.d.ts +16 -0
  31. package/dist/commands/login.d.ts.map +1 -0
  32. package/dist/commands/login.js +287 -0
  33. package/dist/commands/login.js.map +1 -0
  34. package/dist/commands/logout.d.ts +7 -0
  35. package/dist/commands/logout.d.ts.map +1 -0
  36. package/dist/commands/logout.js +19 -0
  37. package/dist/commands/logout.js.map +1 -0
  38. package/dist/commands/mcp.d.ts +21 -0
  39. package/dist/commands/mcp.d.ts.map +1 -0
  40. package/dist/commands/mcp.js +331 -0
  41. package/dist/commands/mcp.js.map +1 -0
  42. package/dist/commands/whoami.d.ts +7 -0
  43. package/dist/commands/whoami.d.ts.map +1 -0
  44. package/dist/commands/whoami.js +37 -0
  45. package/dist/commands/whoami.js.map +1 -0
  46. package/dist/cursor/quickback.mdc +277 -0
  47. package/dist/docs/content.d.ts +7 -0
  48. package/dist/docs/content.d.ts.map +1 -0
  49. package/dist/docs/content.js +577 -0
  50. package/dist/docs/content.js.map +1 -0
  51. package/dist/examples/recruitment.tar.gz +0 -0
  52. package/dist/index.d.ts +12 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +188 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/lib/api-client.d.ts +103 -0
  57. package/dist/lib/api-client.d.ts.map +1 -0
  58. package/dist/lib/api-client.js +231 -0
  59. package/dist/lib/api-client.js.map +1 -0
  60. package/dist/lib/api-client.test.d.ts +2 -0
  61. package/dist/lib/api-client.test.d.ts.map +1 -0
  62. package/dist/lib/api-client.test.js +133 -0
  63. package/dist/lib/api-client.test.js.map +1 -0
  64. package/dist/lib/artifact-routing.d.ts +8 -0
  65. package/dist/lib/artifact-routing.d.ts.map +1 -0
  66. package/dist/lib/artifact-routing.js +34 -0
  67. package/dist/lib/artifact-routing.js.map +1 -0
  68. package/dist/lib/artifact-routing.test.d.ts +2 -0
  69. package/dist/lib/artifact-routing.test.d.ts.map +1 -0
  70. package/dist/lib/artifact-routing.test.js +37 -0
  71. package/dist/lib/artifact-routing.test.js.map +1 -0
  72. package/dist/lib/async-utils.d.ts +6 -0
  73. package/dist/lib/async-utils.d.ts.map +1 -0
  74. package/dist/lib/async-utils.js +26 -0
  75. package/dist/lib/async-utils.js.map +1 -0
  76. package/dist/lib/auth.d.ts +55 -0
  77. package/dist/lib/auth.d.ts.map +1 -0
  78. package/dist/lib/auth.js +102 -0
  79. package/dist/lib/auth.js.map +1 -0
  80. package/dist/lib/compiler-stubs.d.ts +108 -0
  81. package/dist/lib/compiler-stubs.d.ts.map +1 -0
  82. package/dist/lib/compiler-stubs.js +142 -0
  83. package/dist/lib/compiler-stubs.js.map +1 -0
  84. package/dist/lib/drizzle-meta-routing.test.d.ts +2 -0
  85. package/dist/lib/drizzle-meta-routing.test.d.ts.map +1 -0
  86. package/dist/lib/drizzle-meta-routing.test.js +123 -0
  87. package/dist/lib/drizzle-meta-routing.test.js.map +1 -0
  88. package/dist/lib/file-loader.d.ts +165 -0
  89. package/dist/lib/file-loader.d.ts.map +1 -0
  90. package/dist/lib/file-loader.js +577 -0
  91. package/dist/lib/file-loader.js.map +1 -0
  92. package/dist/lib/file-loader.test.d.ts +2 -0
  93. package/dist/lib/file-loader.test.d.ts.map +1 -0
  94. package/dist/lib/file-loader.test.js +75 -0
  95. package/dist/lib/file-loader.test.js.map +1 -0
  96. package/dist/lib/file-writer.d.ts +30 -0
  97. package/dist/lib/file-writer.d.ts.map +1 -0
  98. package/dist/lib/file-writer.js +122 -0
  99. package/dist/lib/file-writer.js.map +1 -0
  100. package/dist/lib/helpers.d.ts +39 -0
  101. package/dist/lib/helpers.d.ts.map +1 -0
  102. package/dist/lib/helpers.js +299 -0
  103. package/dist/lib/helpers.js.map +1 -0
  104. package/dist/lib/markdown-renderer.d.ts +8 -0
  105. package/dist/lib/markdown-renderer.d.ts.map +1 -0
  106. package/dist/lib/markdown-renderer.js +151 -0
  107. package/dist/lib/markdown-renderer.js.map +1 -0
  108. package/dist/lib/shell.d.ts +15 -0
  109. package/dist/lib/shell.d.ts.map +1 -0
  110. package/dist/lib/shell.js +32 -0
  111. package/dist/lib/shell.js.map +1 -0
  112. package/dist/skill/SKILL.md +887 -0
  113. package/dist/skill/agents/quickback-specialist/AGENT.md +298 -0
  114. package/dist/templates/registry.d.ts +36 -0
  115. package/dist/templates/registry.d.ts.map +1 -0
  116. package/dist/templates/registry.js +181 -0
  117. package/dist/templates/registry.js.map +1 -0
  118. package/package.json +55 -0
  119. package/src/cursor/quickback.mdc +277 -0
  120. package/src/examples/recruitment.tar.gz +0 -0
  121. package/src/skill/SKILL.md +887 -0
  122. package/src/skill/agents/quickback-specialist/AGENT.md +298 -0
@@ -0,0 +1,298 @@
1
+ ---
2
+ name: quickback-specialist
3
+ description: Expert at building Quickback applications. Use proactively when creating resources, configuring security layers (Firewall, Access, Guards, Masking), defining actions, or debugging Quickback configurations. Delegates exploration and code generation for Quickback projects.
4
+ tools: Read, Write, Edit, Glob, Grep, Bash
5
+ model: sonnet
6
+ skills:
7
+ - quickback
8
+ ---
9
+
10
+ You are a Quickback specialist - an expert at building secure, multi-tenant backends using Quickback's security layer system.
11
+
12
+ ## Your Expertise
13
+
14
+ You deeply understand:
15
+ - **Firewall**: Data isolation via compiled WHERE clauses (organization, owner, team, softDelete)
16
+ - **Access**: Role-based and record-level permissions (deny by default)
17
+ - **Guards**: Field protection (createable, updatable, immutable, protected)
18
+ - **Masking**: PII redaction with role-based visibility and auto-detection
19
+ - **Actions**: Custom endpoints using `defineActions()` with Zod schemas
20
+ - **Views**: Column-level security with named projections
21
+ - **Validation**: Field-level validation rules
22
+ - **Layouts**: CMS record page field grouping with sections, columns, and collapsed state
23
+ - **Account UI**: Pre-built auth/account/org/admin SPA with compile-time feature gating
24
+
25
+ ## When Invoked
26
+
27
+ 1. **Understand the requirement** - What kind of resource? What security pattern?
28
+ 2. **Choose the right pattern**:
29
+ - Multi-tenant B2B → Organization-scoped firewall
30
+ - Personal data → Owner-scoped firewall
31
+ - Hierarchical access → Organization + owner-optional
32
+ - Public/reference data → `exception: true`
33
+ 3. **Generate complete configuration** including:
34
+ - Drizzle schema with correct dialect
35
+ - `defineTable()` with all security layers in a single file
36
+ - Actions via `defineActions()` with Zod input schemas (if needed)
37
+ 4. **Validate the configuration** - Check for common mistakes
38
+ 5. **Explain your decisions** - Help users understand the security model
39
+
40
+ ## Code Generation
41
+
42
+ Schema + security config in a single file using `defineTable()`.
43
+
44
+ Generate files in `quickback/features/{name}/`:
45
+ - `{table}.ts` - Drizzle schema + security config via `defineTable()` (DO NOT add audit fields - they're auto-injected)
46
+ - `actions.ts` - Custom actions via `defineActions()` with Zod schemas (if needed)
47
+ - `handlers/` - Action handler files (if needed)
48
+
49
+ When explaining compile outputs:
50
+ - Runtime outputs remain in `build.outputDir`.
51
+ - Drizzle migration SQL and meta files live under `quickback/drizzle/...`. This is the only location — Quickback owns this state and never reads from or writes to a project-root `drizzle/` folder.
52
+ - Security contract reports should live in `quickback/reports/...` when a `quickback/` folder exists.
53
+
54
+ Detect the database dialect from `quickback.config.ts`:
55
+ - Cloudflare D1 / SQLite: Use `sqliteTable`, `text`, `integer` from `drizzle-orm/sqlite-core`
56
+ - Supabase / PostgreSQL: Use `pgTable`, `text`, `boolean`, `timestamp` from `drizzle-orm/pg-core`
57
+
58
+ ### Table Definition Pattern
59
+
60
+ ```typescript
61
+ import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
62
+ import { defineTable } from "@quickback/compiler";
63
+
64
+ export const todos = sqliteTable("todos", {
65
+ id: integer("id").primaryKey(),
66
+ title: text("title").notNull(),
67
+ completed: integer("completed", { mode: "boolean" }).default(false),
68
+ userId: text("user_id").notNull(),
69
+ organizationId: text("organization_id").notNull(),
70
+ });
71
+
72
+ export default defineTable(todos, {
73
+ firewall: {
74
+ organization: {}, // Auto-detects 'organizationId' column
75
+ owner: {}, // Auto-detects 'userId' column
76
+ },
77
+ crud: {
78
+ list: { access: { roles: ["member", "admin"] } },
79
+ get: { access: { roles: ["member", "admin"] } },
80
+ create: { access: { roles: ["member", "admin"] } },
81
+ update: { access: { roles: ["admin"] } },
82
+ delete: { access: { roles: ["admin"] }, mode: "soft" },
83
+ },
84
+ guards: {
85
+ createable: ["title", "completed"],
86
+ updatable: ["title", "completed"],
87
+ },
88
+ masking: {
89
+ userId: { type: "redact", show: { roles: ["admin"] } },
90
+ },
91
+ });
92
+ ```
93
+
94
+ ### Actions Pattern
95
+
96
+ ```typescript
97
+ // quickback/features/todos/actions.ts
98
+ import { todos } from './todos';
99
+ import { defineActions } from '@quickback/compiler';
100
+ import { z } from 'zod';
101
+
102
+ export default defineActions(todos, {
103
+ complete: {
104
+ description: "Mark todo as complete",
105
+ input: z.object({
106
+ completedAt: z.string().datetime().optional(),
107
+ }),
108
+ guard: {
109
+ roles: ["member", "admin"],
110
+ record: { completed: { equals: false } },
111
+ },
112
+ execute: async ({ db, record, ctx, input }) => {
113
+ await db.update(todos).set({ completed: true }).where(eq(todos.id, record.id));
114
+ return { success: true };
115
+ },
116
+ },
117
+ });
118
+ ```
119
+
120
+ ## Security Principles
121
+
122
+ 1. **Secure by default** - Nothing is accessible until explicitly opened
123
+ 2. **Defense in depth** - Multiple layers work together
124
+ 3. **Principle of least privilege** - Grant minimum necessary access
125
+ 4. **Explicit over implicit** - Always define access rules clearly
126
+
127
+ ## Common Patterns You Implement
128
+
129
+ ### Multi-tenant resource
130
+ ```typescript
131
+ firewall: {
132
+ organization: {} // Auto-detects organizationId column
133
+ }
134
+ ```
135
+
136
+ ### Owner-scoped with admin override
137
+ ```typescript
138
+ firewall: {
139
+ organization: {},
140
+ owner: { mode: 'optional' } // Admins see all, users see own
141
+ }
142
+ ```
143
+
144
+ ### Workflow with protected status
145
+ ```typescript
146
+ guards: {
147
+ protected: { status: ['approve', 'reject'] }
148
+ }
149
+ // Plus defineActions() for approve/reject
150
+ ```
151
+
152
+ ### PII masking
153
+ ```typescript
154
+ masking: {
155
+ email: { type: 'email', show: { roles: ['admin'] } },
156
+ ssn: { type: 'ssn', show: { roles: ['hr'] } }
157
+ }
158
+ ```
159
+
160
+ ### Views (column-level security)
161
+ ```typescript
162
+ views: {
163
+ summary: {
164
+ fields: ['id', 'name', 'email'],
165
+ access: { roles: ['member+'] }, // member, admin, owner
166
+ },
167
+ full: {
168
+ fields: ['id', 'name', 'email', 'phone', 'ssn'],
169
+ access: { roles: ['admin+'] }, // admin, owner
170
+ },
171
+ }
172
+ ```
173
+
174
+ > Use `+` suffix with `auth.roleHierarchy` configured (e.g., `['member', 'admin', 'owner']`) to expand roles at compile time. `"member+"` → `["member", "admin", "owner"]`.
175
+
176
+ ### Standalone actions (not record-based)
177
+ ```typescript
178
+ // In actions.ts
179
+ chat: {
180
+ standalone: true,
181
+ path: "/chat",
182
+ method: "POST",
183
+ responseType: "stream",
184
+ input: z.object({ message: z.string() }),
185
+ guard: { roles: ["member"] },
186
+ handler: "./handlers/chat",
187
+ }
188
+ ```
189
+
190
+ ### Actions-only features (no tables)
191
+ ```typescript
192
+ // quickback/features/utilities/actions.ts
193
+ import { defineActions } from '@quickback/compiler';
194
+ import { z } from 'zod';
195
+
196
+ export default defineActions(null, {
197
+ healthCheck: {
198
+ standalone: true,
199
+ path: "/health",
200
+ method: "GET",
201
+ description: "Health check endpoint",
202
+ input: z.object({}),
203
+ guard: { roles: ["member", "admin"] },
204
+ handler: "./handlers/health-check",
205
+ },
206
+ });
207
+ ```
208
+ All actions must have `standalone: true` when there is no table.
209
+
210
+ ### Public actions (no auth required)
211
+ Use `roles: ["PUBLIC"]` for unauthenticated endpoints. Every invocation is mandatory audit logged.
212
+ ```typescript
213
+ submit: {
214
+ standalone: true,
215
+ path: "/submit",
216
+ description: "Public contact form",
217
+ input: z.object({ name: z.string(), email: z.string().email(), message: z.string() }),
218
+ access: { roles: ["PUBLIC"] },
219
+ handler: "./handlers/submit",
220
+ }
221
+ ```
222
+ The wildcard `"*"` is NOT supported and will throw a compile error. Use `"PUBLIC"` explicitly.
223
+
224
+ ### Account UI configuration
225
+ ```typescript
226
+ // quickback.config.ts
227
+ export default defineConfig({
228
+ name: "my-app",
229
+ account: {
230
+ domain: "auth.example.com", // Custom domain (optional)
231
+ adminDomain: "admin.example.com", // Separate admin domain (optional)
232
+ name: "My App",
233
+ companyName: "My Company",
234
+ auth: {
235
+ password: true, // Email/password (default: false)
236
+ emailOTP: true, // Email OTP (default: true)
237
+ passkey: true, // WebAuthn passkeys (default: true)
238
+ signup: true, // Registration (default: true)
239
+ organizations: true, // Multi-tenant orgs (default: true)
240
+ admin: true, // Admin panel (default: true)
241
+ emailVerification: true,
242
+ },
243
+ },
244
+ // ...
245
+ });
246
+ ```
247
+ Minimal: `account: true`. Skip rebuild: `account: { build: false }`.
248
+ Disabled features are excluded at build time (route files removed before Vite build).
249
+ Served at `/account/` (unified domain) or `/` (custom domain).
250
+
251
+ ### Custom dependencies in generated package.json
252
+ ```typescript
253
+ // quickback.config.ts
254
+ export default defineConfig({
255
+ // ...
256
+ build: {
257
+ dependencies: {
258
+ "fast-xml-parser": "^4.5.0",
259
+ },
260
+ },
261
+ });
262
+ ```
263
+
264
+ ## Validation Checklist
265
+
266
+ Before finishing, verify:
267
+ - [ ] Firewall configured (or explicit `exception: true`)
268
+ - [ ] Access rules for all CRUD operations
269
+ - [ ] Guards define createable/updatable fields
270
+ - [ ] Protected fields have corresponding actions
271
+ - [ ] Masking for any PII fields
272
+ - [ ] Views for different visibility levels (if needed)
273
+ - [ ] Validation rules for constrained fields (if needed)
274
+ - [ ] Layouts for CMS record page field grouping (if needed)
275
+ - [ ] No audit fields in schema (auto-injected)
276
+ - [ ] Using `defineTable()` (not separate schema.ts + resource.ts)
277
+ - [ ] Actions use `defineActions()` with Zod schemas (not JSON schema)
278
+ - [ ] Account UI configured if auth UI needed (`account: true` or `account: { ... }`)
279
+
280
+ ## Accessing Documentation
281
+
282
+ When you need to look up Quickback docs, use the CLI — it bundles all docs offline:
283
+
284
+ ```bash
285
+ quickback docs # List all available topics
286
+ quickback docs <topic> # Show docs for a specific topic
287
+ quickback docs firewall # Example: firewall docs
288
+ quickback docs cms/record-layouts # Example: CMS record layouts
289
+ ```
290
+
291
+ Full online docs: https://docs.quickback.dev
292
+
293
+ ## Response Style
294
+
295
+ - Be direct and practical
296
+ - Show complete, working code
297
+ - Explain security decisions briefly
298
+ - Suggest improvements when relevant
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Template Registry
3
+ *
4
+ * Defines available project templates for quickback create command.
5
+ * The server is the source of truth for templates and tiers.
6
+ * This local registry serves as a fallback when offline.
7
+ */
8
+ import { type TemplateInfo } from '../lib/api-client.js';
9
+ export interface TemplateDefinition {
10
+ name: string;
11
+ description: string;
12
+ category: "auth" | "saas" | "api" | "payments";
13
+ tags: string[];
14
+ author: string;
15
+ version: string;
16
+ includes: string[];
17
+ preset: string;
18
+ requiresCloudflare: boolean;
19
+ tier: 'free' | 'pro';
20
+ }
21
+ /**
22
+ * Fetch templates from server (with caching)
23
+ */
24
+ export declare function fetchServerTemplates(): Promise<Record<string, TemplateInfo>>;
25
+ /**
26
+ * Check if a template requires pro tier
27
+ */
28
+ export declare function isProTemplate(templateName: string): Promise<boolean>;
29
+ export declare const TEMPLATE_REGISTRY: Record<string, TemplateDefinition>;
30
+ export declare const TEMPLATE_ALIASES: Record<string, string>;
31
+ export declare function getTemplate(nameOrAlias: string): TemplateDefinition | undefined;
32
+ export declare function listTemplates(): TemplateDefinition[];
33
+ export declare function listTemplateNames(): string[];
34
+ export declare function listAliases(): Record<string, string>;
35
+ export declare function formatTemplateList(): string;
36
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACxB;AAKD;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAYlF;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAY1E;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAmGhE,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWnD,CAAC;AAEF,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAG/E;AAED,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAEpD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAED,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEpD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAgB3C"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Template Registry
3
+ *
4
+ * Defines available project templates for quickback create command.
5
+ * The server is the source of truth for templates and tiers.
6
+ * This local registry serves as a fallback when offline.
7
+ */
8
+ import { fetchTemplates } from '../lib/api-client.js';
9
+ // Cache for server templates
10
+ let serverTemplatesCache = null;
11
+ /**
12
+ * Fetch templates from server (with caching)
13
+ */
14
+ export async function fetchServerTemplates() {
15
+ if (serverTemplatesCache) {
16
+ return serverTemplatesCache;
17
+ }
18
+ try {
19
+ serverTemplatesCache = await fetchTemplates();
20
+ return serverTemplatesCache;
21
+ }
22
+ catch {
23
+ // Fallback to local registry
24
+ return {};
25
+ }
26
+ }
27
+ /**
28
+ * Check if a template requires pro tier
29
+ */
30
+ export async function isProTemplate(templateName) {
31
+ const serverTemplates = await fetchServerTemplates();
32
+ const resolved = TEMPLATE_ALIASES[templateName] || templateName;
33
+ // Check server first
34
+ if (serverTemplates[resolved]) {
35
+ return serverTemplates[resolved].tier === 'pro';
36
+ }
37
+ // Fallback to local
38
+ const local = TEMPLATE_REGISTRY[resolved];
39
+ return local?.tier === 'pro';
40
+ }
41
+ export const TEMPLATE_REGISTRY = {
42
+ // Free tier templates
43
+ "betterauth-d1-cloudflare": {
44
+ name: "Better Auth + D1 + Cloudflare",
45
+ description: "Authentication with Better Auth, D1 database, deployed to Cloudflare Workers",
46
+ category: "auth",
47
+ tags: ["auth", "cloudflare", "d1", "hono"],
48
+ author: "quickback",
49
+ version: "1.0.0",
50
+ includes: ["betterauth", "d1", "hono", "drizzle"],
51
+ preset: "cloudflare",
52
+ requiresCloudflare: true,
53
+ tier: "free",
54
+ },
55
+ "betterauth-sqlite-bun": {
56
+ name: "Better Auth + SQLite + Bun",
57
+ description: "Local development with Better Auth, SQLite database, running on Bun",
58
+ category: "auth",
59
+ tags: ["auth", "bun", "sqlite", "local"],
60
+ author: "quickback",
61
+ version: "1.0.0",
62
+ includes: ["betterauth", "better-sqlite3", "hono", "drizzle"],
63
+ preset: "bun",
64
+ requiresCloudflare: false,
65
+ tier: "free",
66
+ },
67
+ // Pro tier templates
68
+ "betterauth-libsql-turso": {
69
+ name: "Better Auth + LibSQL + Turso",
70
+ description: "Authentication with Better Auth, Turso/LibSQL database",
71
+ category: "auth",
72
+ tags: ["auth", "turso", "libsql", "edge"],
73
+ author: "quickback",
74
+ version: "1.0.0",
75
+ includes: ["betterauth", "libsql", "hono", "drizzle"],
76
+ preset: "turso",
77
+ requiresCloudflare: false,
78
+ tier: "pro",
79
+ },
80
+ "b2bsaas-cloudflare": {
81
+ name: "B2B SaaS Starter",
82
+ description: "Full B2B SaaS with auth, organizations, file storage (R2), webhooks, and views",
83
+ category: "saas",
84
+ tags: ["saas", "b2b", "cloudflare", "r2", "webhooks", "teams"],
85
+ author: "quickback",
86
+ version: "1.0.0",
87
+ includes: ["betterauth", "organizations", "d1", "r2", "files", "webhooks", "hono", "drizzle"],
88
+ preset: "cloudflare",
89
+ requiresCloudflare: true,
90
+ tier: "pro",
91
+ },
92
+ "api-minimal-bun": {
93
+ name: "Minimal API (no auth)",
94
+ description: "Lightweight API with just database and routes, no authentication",
95
+ category: "api",
96
+ tags: ["api", "minimal", "bun", "sqlite"],
97
+ author: "quickback",
98
+ version: "1.0.0",
99
+ includes: ["hono", "drizzle", "better-sqlite3"],
100
+ preset: "bun",
101
+ requiresCloudflare: false,
102
+ tier: "free",
103
+ },
104
+ "blog-cloudflare": {
105
+ name: "Blog / CMS Starter",
106
+ description: "Single-tenant blog with public pages, admin-only editing, deployed to Cloudflare Workers",
107
+ category: "api",
108
+ tags: ["blog", "cms", "single-tenant", "cloudflare", "d1"],
109
+ author: "quickback",
110
+ version: "1.0.0",
111
+ includes: ["betterauth", "d1", "hono", "drizzle"],
112
+ preset: "blog",
113
+ requiresCloudflare: true,
114
+ tier: "free",
115
+ },
116
+ "empty-cloudflare": {
117
+ name: "Empty Scaffold (Cloudflare)",
118
+ description: "Empty project structure with config only — no example features. Add your own definitions.",
119
+ category: "api",
120
+ tags: ["empty", "scaffold", "cloudflare", "d1"],
121
+ author: "quickback",
122
+ version: "1.0.0",
123
+ includes: ["betterauth", "d1", "hono", "drizzle"],
124
+ preset: "cloudflare",
125
+ requiresCloudflare: true,
126
+ tier: "free",
127
+ },
128
+ "empty-bun": {
129
+ name: "Empty Scaffold (Bun)",
130
+ description: "Empty project structure with config only — no example features. Add your own definitions.",
131
+ category: "api",
132
+ tags: ["empty", "scaffold", "bun", "sqlite"],
133
+ author: "quickback",
134
+ version: "1.0.0",
135
+ includes: ["betterauth", "better-sqlite3", "hono", "drizzle"],
136
+ preset: "bun",
137
+ requiresCloudflare: false,
138
+ tier: "free",
139
+ },
140
+ };
141
+ // Aliases for common shortcuts
142
+ export const TEMPLATE_ALIASES = {
143
+ "cloudflare": "betterauth-d1-cloudflare",
144
+ "cf": "betterauth-d1-cloudflare",
145
+ "bun": "betterauth-sqlite-bun",
146
+ "local": "betterauth-sqlite-bun",
147
+ "turso": "betterauth-libsql-turso",
148
+ "saas": "b2bsaas-cloudflare",
149
+ "minimal": "api-minimal-bun",
150
+ "blog": "blog-cloudflare",
151
+ "empty": "empty-cloudflare",
152
+ "scaffold": "empty-cloudflare",
153
+ };
154
+ export function getTemplate(nameOrAlias) {
155
+ const resolved = TEMPLATE_ALIASES[nameOrAlias] || nameOrAlias;
156
+ return TEMPLATE_REGISTRY[resolved];
157
+ }
158
+ export function listTemplates() {
159
+ return Object.values(TEMPLATE_REGISTRY);
160
+ }
161
+ export function listTemplateNames() {
162
+ return Object.keys(TEMPLATE_REGISTRY);
163
+ }
164
+ export function listAliases() {
165
+ return TEMPLATE_ALIASES;
166
+ }
167
+ export function formatTemplateList() {
168
+ const lines = ["Available templates:\n"];
169
+ for (const [id, template] of Object.entries(TEMPLATE_REGISTRY)) {
170
+ lines.push(` ${id}`);
171
+ lines.push(` ${template.description}`);
172
+ lines.push(` Tags: ${template.tags.join(", ")}`);
173
+ lines.push("");
174
+ }
175
+ lines.push("Aliases:");
176
+ for (const [alias, target] of Object.entries(TEMPLATE_ALIASES)) {
177
+ lines.push(` ${alias} -> ${target}`);
178
+ }
179
+ return lines.join("\n");
180
+ }
181
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AAezE,6BAA6B;AAC7B,IAAI,oBAAoB,GAAwC,IAAI,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACtC,IAAI,oBAAoB,EAAE,CAAC;QACvB,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAED,IAAI,CAAC;QACD,oBAAoB,GAAG,MAAM,cAAc,EAAE,CAAC;QAC9C,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACL,6BAA6B;QAC7B,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED;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AM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@quickback-dev/cli",
3
+ "version": "0.9.5",
4
+ "description": "CLI for Quickback - one-shot backend generator",
5
+ "author": "Paul Stenhouse",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "bin": {
9
+ "quickback": "./dist/index.js"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "files": [
13
+ "dist/**/*",
14
+ "src/skill/**/*",
15
+ "src/cursor/**/*",
16
+ "src/examples/**/*"
17
+ ],
18
+ "scripts": {
19
+ "prebuild": "npx tsx scripts/inject-version.ts && npm run bundle:docs && npm run bundle:skill && npm run bundle:examples",
20
+ "build": "tsc",
21
+ "postbuild": "npx tsx scripts/bundle-cursor.ts && rm -rf dist/skill dist/examples && cp -r src/skill dist/skill && cp -r src/examples dist/examples",
22
+ "dev": "tsc --watch",
23
+ "test": "bun test",
24
+ "typecheck": "tsc --noEmit",
25
+ "bundle:docs": "npx tsx scripts/bundle-docs.ts",
26
+ "bundle:skill": "npx tsx scripts/bundle-skill.ts",
27
+ "bundle:cursor": "npx tsx scripts/bundle-cursor.ts",
28
+ "bundle:examples": "npx tsx scripts/bundle-examples.ts"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/sdk": "^1.11.0",
32
+ "esbuild": "^0.27.2",
33
+ "ora": "^9.0.0",
34
+ "picocolors": "^1.0.0",
35
+ "prompts": "^2.4.2"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^22.7.5",
39
+ "@types/prompts": "^2.4.9",
40
+ "bun-types": "^1.3.5",
41
+ "tsx": "^4.19.0",
42
+ "typescript": "^5.9.0"
43
+ },
44
+ "peerDependencies": {
45
+ "typescript": ">=5.0.0"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "typescript": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ }
55
+ }