caspian-utils 0.0.8 → 0.0.9
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/dist/docs/commands.md +225 -63
- package/dist/docs/index.md +1 -1
- package/package.json +1 -1
package/dist/docs/commands.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Commands
|
|
3
|
-
description: Use
|
|
3
|
+
description: Use this Caspian CLI reference to choose the right create, starter-kit, update, and Prisma-to-Python ORM regeneration flow for the current workspace.
|
|
4
4
|
related:
|
|
5
5
|
title: Related docs
|
|
6
|
-
description: Start with installation for new apps, then use
|
|
6
|
+
description: Start with installation for new apps, then use database and structure docs when commands affect schema, generated ORM files, or project layout.
|
|
7
7
|
links:
|
|
8
8
|
- /docs/installation
|
|
9
9
|
- /docs/database
|
|
@@ -12,119 +12,281 @@ related:
|
|
|
12
12
|
- /docs/index
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
This page
|
|
15
|
+
This page documents the current Caspian command families used with this workspace and the surrounding docs toolchain.
|
|
16
16
|
|
|
17
17
|
## Overview
|
|
18
18
|
|
|
19
|
-
The current workspace includes a local `prisma` binary, but it does not include local `create-caspian-app`, `casp`, or `ppy` binaries under `node_modules/.bin`. Treat
|
|
19
|
+
The current workspace includes a local `prisma` binary, but it does not include local `create-caspian-app`, `casp`, or `ppy` binaries under `node_modules/.bin`. Treat project creation, project update, and Python ORM generation as external `npx` workflows rather than project-local executables.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Examples below use the bare package name for readability. If you want to force the latest published scaffold package, you can add `@latest`, for example `npx create-caspian-app@latest my-app`.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- Regenerate Node and Python ORM code from your Prisma schema.
|
|
25
|
-
- Update framework-managed project files.
|
|
23
|
+
Use these command families for different tasks:
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
| Task | Command | When to use |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Create a new project | `npx create-caspian-app my-app` | First-time scaffold for a brand new Caspian app. |
|
|
28
|
+
| Update an existing project | `npx casp update project` | Refresh framework-managed files inside an existing Caspian project. |
|
|
29
|
+
| Create from a starter kit | `npx create-caspian-app my-app --starter-kit=fullstack` | Start from a built-in or custom template instead of the default scaffold. |
|
|
30
|
+
| List starter kits | `npx create-caspian-app --list-starter-kits` | Inspect the starter catalog before choosing a preset. |
|
|
31
|
+
| Regenerate ORM after schema change | `npx prisma migrate dev` then optional seed commands, then `npx ppy generate` | Keep Prisma migrations, seed flow, and generated Python ORM files aligned after `prisma/schema.prisma` changes. |
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
Before running `npx casp update project`, read `caspian.config.json` because it controls feature flags and `excludeFiles` overwrite protection. Before running Prisma or `ppy` commands, read [database.md](./database.md).
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
## Supported Flags
|
|
36
|
+
|
|
37
|
+
The scaffold CLI exposes these feature flags:
|
|
38
|
+
|
|
39
|
+
| Flag | Meaning | When to use |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| `-y` | Non-interactive mode | Use in CI, automation, or scripted setup. |
|
|
42
|
+
| `--backend-only` | Backend-only project | Use for APIs, services, or apps with no browser UI. |
|
|
43
|
+
| `--tailwindcss` | Enable Tailwind CSS | Use for frontend or full-stack styling. |
|
|
44
|
+
| `--typescript` | Enable TypeScript frontend tooling | Use when you want frontend TypeScript assets. |
|
|
45
|
+
| `--mcp` | Enable MCP support | Use when the app needs Model Context Protocol support. |
|
|
46
|
+
| `--prisma` | Enable Prisma setup | Use when the app needs schema, migration, and ORM tooling. |
|
|
47
|
+
| `--starter-kit=<kit>` | Use a built-in or named starter kit | Use to bootstrap from a preset instead of the default scaffold. |
|
|
48
|
+
| `--starter-kit-source=<url>` | Pull a starter kit from a Git source | Use when the starter kit lives in an external repository. |
|
|
49
|
+
|
|
50
|
+
Add `-y` to most create or update examples below when you want the same flow to run without prompts.
|
|
51
|
+
|
|
52
|
+
## Create a New Project
|
|
53
|
+
|
|
54
|
+
### Interactive create
|
|
32
55
|
|
|
33
56
|
```bash
|
|
34
|
-
npx create-caspian-app
|
|
57
|
+
npx create-caspian-app my-app
|
|
35
58
|
```
|
|
36
59
|
|
|
37
|
-
|
|
60
|
+
Use when you want the normal interactive scaffold flow. The CLI can prompt for project name and feature toggles.
|
|
61
|
+
|
|
62
|
+
### Non-interactive create
|
|
38
63
|
|
|
39
64
|
```bash
|
|
40
|
-
npx create-caspian-app my-app
|
|
65
|
+
npx create-caspian-app my-app -y
|
|
41
66
|
```
|
|
42
67
|
|
|
43
|
-
|
|
68
|
+
Use when you already know the desired feature flags or when automation should avoid prompts.
|
|
69
|
+
|
|
70
|
+
Without extra flags, the non-interactive default behaves like this:
|
|
71
|
+
|
|
72
|
+
- `backendOnly: false`
|
|
73
|
+
- `tailwindcss: false`
|
|
74
|
+
- `typescript: false`
|
|
75
|
+
- `mcp: false`
|
|
76
|
+
- `prisma: false`
|
|
77
|
+
|
|
78
|
+
## Backend-only Create Combinations
|
|
79
|
+
|
|
80
|
+
When `--backend-only` is enabled, the meaningful feature toggles are `--mcp` and `--prisma`. Frontend-oriented flags are not part of the normal backend-only prompt flow.
|
|
81
|
+
|
|
82
|
+
| Goal | Example command | When to use |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| Minimal backend-only | `npx create-caspian-app my-app --backend-only` | Simple API or service without frontend assets. |
|
|
85
|
+
| Backend-only + MCP | `npx create-caspian-app my-app --backend-only --mcp` | Backend service plus MCP support. |
|
|
86
|
+
| Backend-only + Prisma | `npx create-caspian-app my-app --backend-only --prisma` | API or service with database and ORM support. |
|
|
87
|
+
| Backend-only + MCP + Prisma | `npx create-caspian-app my-app --backend-only --mcp --prisma` | Full backend-only setup with both integrations. |
|
|
88
|
+
|
|
89
|
+
You can append `-y` to any backend-only example above.
|
|
90
|
+
|
|
91
|
+
### Accepted but not recommended in backend-only mode
|
|
44
92
|
|
|
45
93
|
```bash
|
|
46
|
-
npx create-caspian-app my-
|
|
94
|
+
npx create-caspian-app my-app --backend-only --tailwindcss
|
|
95
|
+
npx create-caspian-app my-app --backend-only --typescript
|
|
96
|
+
npx create-caspian-app my-app --backend-only --tailwindcss --typescript
|
|
47
97
|
```
|
|
48
98
|
|
|
49
|
-
|
|
99
|
+
Avoid them in normal use. Backend-only mode strips frontend assets, so Tailwind and frontend TypeScript flags do not have a practical effect in the resulting scaffold.
|
|
50
100
|
|
|
51
|
-
##
|
|
101
|
+
## Full-stack and Frontend-enabled Create Combinations
|
|
52
102
|
|
|
53
|
-
|
|
103
|
+
When `--backend-only` is not used, the feature flags `--tailwindcss`, `--typescript`, `--mcp`, and `--prisma` can be combined in any subset. The table below lists the common command matrix.
|
|
54
104
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
105
|
+
| Flags | Example command | When to use |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| none | `npx create-caspian-app my-app` | Default full-stack scaffold. |
|
|
108
|
+
| `--tailwindcss` | `npx create-caspian-app my-app --tailwindcss` | Styled frontend with Tailwind. |
|
|
109
|
+
| `--typescript` | `npx create-caspian-app my-app --typescript` | Frontend TypeScript assets. |
|
|
110
|
+
| `--mcp` | `npx create-caspian-app my-app --mcp` | Full-stack app with MCP support. |
|
|
111
|
+
| `--prisma` | `npx create-caspian-app my-app --prisma` | Full-stack app with Prisma support. |
|
|
112
|
+
| `--tailwindcss --typescript` | `npx create-caspian-app my-app --tailwindcss --typescript` | Styled frontend with TypeScript. |
|
|
113
|
+
| `--tailwindcss --mcp` | `npx create-caspian-app my-app --tailwindcss --mcp` | Styled UI plus MCP support. |
|
|
114
|
+
| `--tailwindcss --prisma` | `npx create-caspian-app my-app --tailwindcss --prisma` | Styled UI plus database tooling. |
|
|
115
|
+
| `--typescript --mcp` | `npx create-caspian-app my-app --typescript --mcp` | Frontend TypeScript plus MCP. |
|
|
116
|
+
| `--typescript --prisma` | `npx create-caspian-app my-app --typescript --prisma` | Frontend TypeScript plus Prisma. |
|
|
117
|
+
| `--mcp --prisma` | `npx create-caspian-app my-app --mcp --prisma` | Both major backend integrations without forcing frontend styling choices. |
|
|
118
|
+
| `--tailwindcss --typescript --mcp` | `npx create-caspian-app my-app --tailwindcss --typescript --mcp` | Rich frontend plus MCP. |
|
|
119
|
+
| `--tailwindcss --typescript --prisma` | `npx create-caspian-app my-app --tailwindcss --typescript --prisma` | Rich frontend plus Prisma. |
|
|
120
|
+
| `--tailwindcss --mcp --prisma` | `npx create-caspian-app my-app --tailwindcss --mcp --prisma` | Styled UI plus both major integrations. |
|
|
121
|
+
| `--typescript --mcp --prisma` | `npx create-caspian-app my-app --typescript --mcp --prisma` | Frontend TypeScript plus both major integrations. |
|
|
122
|
+
| `--tailwindcss --typescript --mcp --prisma` | `npx create-caspian-app my-app --tailwindcss --typescript --mcp --prisma` | Most feature-complete default full-stack setup. |
|
|
60
123
|
|
|
61
|
-
|
|
124
|
+
You can append `-y` to any frontend-enabled example above.
|
|
62
125
|
|
|
63
|
-
|
|
126
|
+
## Starter Kit Commands
|
|
127
|
+
|
|
128
|
+
### List available starter kits
|
|
64
129
|
|
|
65
130
|
```bash
|
|
66
|
-
npx
|
|
131
|
+
npx create-caspian-app --list-starter-kits
|
|
132
|
+
```
|
|
67
133
|
|
|
68
|
-
|
|
69
|
-
npx prisma generate
|
|
70
|
-
npx prisma db seed
|
|
134
|
+
Use when you want to inspect the built-in starter kit catalog before creating a project.
|
|
71
135
|
|
|
72
|
-
|
|
136
|
+
### Built-in starter kits
|
|
137
|
+
|
|
138
|
+
The current command reference includes these built-in starter kits:
|
|
139
|
+
|
|
140
|
+
| Starter kit | Example command | Preset features | When to use |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| `basic` | `npx create-caspian-app my-app --starter-kit=basic` | `backendOnly=true`, `tailwindcss=false`, `prisma=false`, `mcp=false` | Minimal backend-oriented scaffold. |
|
|
143
|
+
| `fullstack` | `npx create-caspian-app my-app --starter-kit=fullstack` | `backendOnly=false`, `tailwindcss=true`, `prisma=true`, `mcp=false` | Complete full-stack web app preset. |
|
|
144
|
+
| `api` | `npx create-caspian-app my-app --starter-kit=api` | `backendOnly=true`, `tailwindcss=false`, `prisma=true`, `mcp=false` | Backend API preset with Prisma. |
|
|
145
|
+
| `realtime` | `npx create-caspian-app my-app --starter-kit=realtime` | `backendOnly=false`, `tailwindcss=true`, `prisma=true`, `mcp=true` | Realtime-oriented preset with both UI and integration support. |
|
|
146
|
+
|
|
147
|
+
If you want frontend TypeScript, add `--typescript` explicitly rather than assuming it is implied by a starter kit preset.
|
|
148
|
+
|
|
149
|
+
Append `-y` to any starter kit example when you want the same preset without prompts.
|
|
150
|
+
|
|
151
|
+
### Starter kit overrides
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npx create-caspian-app my-app --starter-kit=basic --prisma
|
|
155
|
+
npx create-caspian-app my-app --starter-kit=fullstack --typescript
|
|
156
|
+
npx create-caspian-app my-app --starter-kit=api --mcp
|
|
157
|
+
npx create-caspian-app my-app --starter-kit=realtime --backend-only
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Use overrides when a starter kit is close to the target app but you need to force one or more feature flags.
|
|
161
|
+
|
|
162
|
+
### Custom starter kit source
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx create-caspian-app my-app --starter-kit=custom --starter-kit-source=https://github.com/user/repo
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
You can combine extra flags with the custom source:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npx create-caspian-app my-app --starter-kit=custom --starter-kit-source=https://github.com/user/repo --typescript --prisma
|
|
73
172
|
```
|
|
74
173
|
|
|
75
|
-
Use
|
|
174
|
+
Use this flow when the scaffold should come from an external repository instead of a built-in preset.
|
|
76
175
|
|
|
77
|
-
|
|
176
|
+
## Update an Existing Project
|
|
78
177
|
|
|
79
|
-
|
|
178
|
+
The updater wrapper recognizes the `update project` family:
|
|
80
179
|
|
|
81
|
-
|
|
180
|
+
```bash
|
|
181
|
+
npx casp update project
|
|
182
|
+
```
|
|
82
183
|
|
|
83
|
-
|
|
184
|
+
Use this only inside an existing Caspian project that already has `caspian.config.json` in the current directory.
|
|
84
185
|
|
|
85
|
-
|
|
186
|
+
### Update to latest
|
|
86
187
|
|
|
87
188
|
```bash
|
|
88
189
|
npx casp update project
|
|
89
190
|
```
|
|
90
191
|
|
|
91
|
-
|
|
192
|
+
Use when you want the normal refresh to the latest framework-managed files.
|
|
193
|
+
|
|
194
|
+
### Update to a specific tag
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npx casp update project @v4-alpha
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Use when you want a prerelease or named tag instead of the latest stable release.
|
|
201
|
+
|
|
202
|
+
### Update to a specific version
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
npx casp update project @1.2.3
|
|
206
|
+
npx casp update project 1.2.3
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Use when you want a deterministic pinned version.
|
|
210
|
+
|
|
211
|
+
### Non-interactive update
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx casp update project -y
|
|
215
|
+
npx casp update project @v4-alpha -y
|
|
216
|
+
npx casp update project @1.2.3 -y
|
|
217
|
+
npx casp update project 1.2.3 -y
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Use when automation, CI, or scripted maintenance should skip confirmation prompts.
|
|
221
|
+
|
|
222
|
+
### Update safety notes
|
|
223
|
+
|
|
224
|
+
The update flow is config-aware. Review `caspian.config.json` before running it, especially these areas:
|
|
225
|
+
|
|
226
|
+
- feature flags such as backend-only, Tailwind, TypeScript, MCP, and Prisma
|
|
227
|
+
- `componentScanDirs`
|
|
228
|
+
- `excludeFiles`, which protects customized files from overwrite
|
|
229
|
+
|
|
230
|
+
If you exclude a file, the updater preserves it, but you are responsible for merging future framework changes into that file manually.
|
|
231
|
+
|
|
232
|
+
## Prisma and Python ORM Regeneration
|
|
233
|
+
|
|
234
|
+
The create and update commands above are not the whole maintenance story for this workspace. When `prisma/schema.prisma` changes, follow the ORM flow below so the TypeScript Prisma client, database state, and Python ORM layer stay aligned.
|
|
235
|
+
|
|
236
|
+
### Required order after `prisma/schema.prisma` changes
|
|
92
237
|
|
|
93
|
-
|
|
238
|
+
```bash
|
|
239
|
+
npx prisma migrate dev
|
|
240
|
+
|
|
241
|
+
# Only when seed flow or prisma/seed.ts depends on the new schema:
|
|
242
|
+
npx prisma generate
|
|
243
|
+
npx prisma db seed
|
|
244
|
+
|
|
245
|
+
npx ppy generate
|
|
246
|
+
```
|
|
94
247
|
|
|
95
|
-
|
|
248
|
+
Use this order:
|
|
96
249
|
|
|
97
|
-
|
|
250
|
+
1. Run `npx prisma migrate dev` first so migrations and the development database stay aligned.
|
|
251
|
+
2. If `prisma/seed.ts` or seed data depends on the new schema, run `npx prisma generate` and then `npx prisma db seed`.
|
|
252
|
+
3. Run `npx ppy generate` last so the Python ORM layer matches the updated Prisma schema.
|
|
98
253
|
|
|
99
|
-
|
|
100
|
-
- Feature toggles such as backend-only, Tailwind, MCP, Prisma, and TypeScript
|
|
101
|
-
- Component scan directories
|
|
102
|
-
- `excludeFiles` rules for protecting local changes during updates
|
|
254
|
+
Do not manually create or edit these generated files:
|
|
103
255
|
|
|
104
|
-
|
|
256
|
+
- `src/lib/prisma/__init__.py`
|
|
257
|
+
- `src/lib/prisma/db.py`
|
|
258
|
+
- `src/lib/prisma/models.py`
|
|
259
|
+
- `settings/prisma-schema.json`
|
|
105
260
|
|
|
106
|
-
|
|
261
|
+
`npx ppy generate` owns those files. Treat `src/lib/prisma/` as the app's generated Python database layer, not as a manual editing surface.
|
|
107
262
|
|
|
108
|
-
|
|
263
|
+
See [database.md](./database.md) for the full schema, migration, seed, and async usage guide.
|
|
109
264
|
|
|
110
|
-
|
|
111
|
-
- Configuration files
|
|
112
|
-
- Entry-point files
|
|
113
|
-
- Other locally modified framework-managed files
|
|
265
|
+
## Practical Recommendation Matrix
|
|
114
266
|
|
|
115
|
-
|
|
267
|
+
| Goal | Recommended command |
|
|
268
|
+
| --- | --- |
|
|
269
|
+
| Minimal backend without database | `npx create-caspian-app my-app --backend-only -y` |
|
|
270
|
+
| Small API or service with Prisma | `npx create-caspian-app my-app --backend-only --prisma -y` |
|
|
271
|
+
| Full-stack app with styled UI and Prisma | `npx create-caspian-app my-app --tailwindcss --prisma -y` |
|
|
272
|
+
| Rich full-stack app with TypeScript, Tailwind, and Prisma | `npx create-caspian-app my-app --tailwindcss --typescript --prisma -y` |
|
|
273
|
+
| Full-stack app with everything enabled | `npx create-caspian-app my-app --tailwindcss --typescript --mcp --prisma -y` |
|
|
274
|
+
| Realtime preset | `npx create-caspian-app my-app --starter-kit=realtime -y` |
|
|
275
|
+
| Update current project to latest | `npx casp update project` |
|
|
276
|
+
| Update current project in automation | `npx casp update project -y` |
|
|
277
|
+
| Update current project to an exact version | `npx casp update project @1.2.3 -y` |
|
|
116
278
|
|
|
117
279
|
## AI Routing Notes
|
|
118
280
|
|
|
119
281
|
If an AI agent is deciding which command flow to use, apply these rules first.
|
|
120
282
|
|
|
121
|
-
- Use `npx create-caspian-app
|
|
122
|
-
- Use `npx casp update project
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
- Never hand-edit generated
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
283
|
+
- Use `npx create-caspian-app ...` only when the user is creating a new Caspian project.
|
|
284
|
+
- Use `npx casp update project ...` only when the user is already inside an existing Caspian project.
|
|
285
|
+
- Add `-y` when the user wants automation, CI, or a no-prompt flow.
|
|
286
|
+
- Treat `--tailwindcss` and `--typescript` as frontend-oriented flags. They are not meaningful in normal backend-only scaffolds.
|
|
287
|
+
- Treat starter kit defaults as a base layer that can be overridden by explicit flags.
|
|
288
|
+
- When `prisma/schema.prisma` changes, run `npx prisma migrate dev` first, then any required seed refresh, then `npx ppy generate`.
|
|
289
|
+
- Never hand-edit generated Python ORM files under `src/lib/prisma/` or `settings/prisma-schema.json`.
|
|
290
|
+
- Read [database.md](./database.md) before generating Prisma schema, migration, seed, or ORM guidance.
|
|
291
|
+
- Read [routing.md](./routing.md) before generating or modifying route folders under `src/app/`.
|
|
292
|
+
- Read [project-structure.md](./project-structure.md) before placing generated files into the project.
|
package/dist/docs/index.md
CHANGED
|
@@ -36,7 +36,7 @@ The packaged Caspian docs distributed by the current toolchain also live here:
|
|
|
36
36
|
## Available Documents
|
|
37
37
|
|
|
38
38
|
- `installation.md` - First-time setup flow for creating a new Caspian application
|
|
39
|
-
- `commands.md` - Main Caspian CLI workflows for project creation,
|
|
39
|
+
- `commands.md` - Main Caspian CLI workflows for project creation, starter kits, updates, and Prisma or ORM-aware maintenance
|
|
40
40
|
- `database.md` - Prisma schema, migration, seed, and client-generation workflow for the current workspace, plus Python-side helper caveats
|
|
41
41
|
- `auth.md` - Session-backed authentication with `casp.auth`, centralized `auth_config.py`, decorators, RBAC, and OAuth provider helpers
|
|
42
42
|
- `components.md` - Create reusable Python components, template-backed UI, JSX-style imports, and the single-parent root rule for component HTML files
|