Skip to content

Commit 9ba8aaa

Browse files
committed
Update README.md
1 parent c3c0484 commit 9ba8aaa

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ For Rapid Development simple [TypeScript Data Models](https://docs.servicestack.
324324

325325
### Cheat Sheet
326326

327+
### Create a new Table
328+
327329
Create a new Table use `init <Table>`, e.g:
328330

329331
```bash
@@ -332,6 +334,32 @@ npx okai init Table
332334

333335
This will generate an empty `MyApp.ServiceModel/<Table>.d.ts` file along with stub AutoQuery APIs and DB Migration implementations.
334336

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+
335363
#### Regenerate AutoQuery APIs and DB Migrations
336364

337365
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:
@@ -385,6 +413,6 @@ npx okai rm Transaction.d.ts
385413
- [ServiceStack Documentation](https://docs.servicestack.net)
386414
- [Vite Documentation](https://vite.dev)
387415
- [Vue Documentation](https://vuejs.org)
388-
- [AutoQuery CRUD](hhttps://docs.servicestack.net/autoquery/crud)
416+
- [AutoQuery CRUD](https://docs.servicestack.net/autoquery/crud)
389417
- [Background Jobs](https://docs.servicestack.net/kamal-deploy)
390418
- [AI Chat API](https://docs.servicestack.net/ai-chat-api)

0 commit comments

Comments
 (0)