You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -324,6 +324,8 @@ For Rapid Development simple [TypeScript Data Models](https://docs.servicestack.
324
324
325
325
### Cheat Sheet
326
326
327
+
### Create a new Table
328
+
327
329
Create a new Table use `init <Table>`, e.g:
328
330
329
331
```bash
@@ -332,6 +334,32 @@ npx okai init Table
332
334
333
335
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
334
336
337
+
### Use AI to generate the TypeScript Data Model
338
+
339
+
Or to get you started quickly you can also use AI to generate the initial TypeScript Data Model with:
340
+
341
+
```bash
342
+
npx okai "Table to store Customer Stripe Subscriptions"
343
+
```
344
+
345
+
This launches a TUI that invokes ServiceStack's okai API to fire multiple concurrent requests to frontier cloud
346
+
and OSS models to generate the TypeScript Data Models required to implement this feature.
347
+
You'll be able to browse and choose which of the AI Models you prefer which you can accept by pressing `a`
348
+
to `(a) accept`. These are the data models [Claude Sonnet 4.5 generated](https://servicestack.net/text-to-blazor?id=1764337230546) generated for this prompt.
349
+
350
+
If your happy to use the data-models as-is you can run the DB Migrations to create these RDBMS tables:
351
+
352
+
```bash
353
+
npm run migrate
354
+
```
355
+
356
+
Otherwise you can make whatever customizations you want to the `Table.d.ts` data models then re-run the `okai` tool to re-generate the AutoQuery APIs and DB Migrations before running the migration.
357
+
358
+
```bash
359
+
npx okai Table.d.ts
360
+
npm run migrate
361
+
```
362
+
335
363
#### Regenerate AutoQuery APIs and DB Migrations
336
364
337
365
After modifying the TypeScript Data Model to include the desired fields, re-run the `okai` tool to re-generate the AutoQuery APIs and DB Migrations:
0 commit comments