@sculptor/cli 0.2.4 → 0.3.1
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/README.md +140 -419
- package/bin/sc.js +0 -0
- package/dist/agents.d.ts +2 -0
- package/dist/agents.js +100 -0
- package/dist/agents.js.map +1 -0
- package/dist/cli.js +212 -19
- package/dist/cli.js.map +1 -1
- package/dist/diagnostics.d.ts +16 -0
- package/dist/diagnostics.js +275 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/package-commands.d.ts +24 -0
- package/dist/package-commands.js +299 -0
- package/dist/package-commands.js.map +1 -0
- package/dist/package-registry.d.ts +37 -0
- package/dist/package-registry.js +477 -0
- package/dist/package-registry.js.map +1 -0
- package/dist/scaffold.d.ts +3 -1
- package/dist/scaffold.js +39 -0
- package/dist/scaffold.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -4,40 +4,53 @@ The SculptorTS CLI is the user-facing command line for the framework.
|
|
|
4
4
|
|
|
5
5
|
It handles:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
7
|
+
- new app scaffolding
|
|
8
|
+
- package-aware and unpackaged resource generation
|
|
9
|
+
- test generation and registry syncing
|
|
10
|
+
- dev and production startup paths
|
|
11
|
+
- package registry maintenance
|
|
12
|
+
- diagnostics and compatibility checks
|
|
13
|
+
- `AGENTS.md` generation
|
|
14
|
+
- app dependency recovery with `sc install deps`
|
|
15
|
+
- global CLI refresh with `sc update`
|
|
16
|
+
- scaffolded `.gitignore` generation
|
|
15
17
|
|
|
16
18
|
## Version Policy
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
- Current
|
|
20
|
-
-
|
|
20
|
+
- Pre-release line: `v0.3.x`
|
|
21
|
+
- Current package version: `0.3.1`
|
|
22
|
+
- This pre-release line adds package-aware generation, `sc doctor`, `sc agents`, `sculptor.packages.json`, and package alias commands.
|
|
23
|
+
- Expect minor changes and fixes until `v1.0.0`.
|
|
21
24
|
|
|
22
25
|
## Quick Command Sheet
|
|
23
26
|
|
|
24
27
|
| Command | What it does |
|
|
25
28
|
| --- | --- |
|
|
26
29
|
| `sc new <app>` | Creates a new app |
|
|
30
|
+
| `sc agents` | Generates `AGENTS.md` |
|
|
31
|
+
| `sc agents refresh` | Regenerates `AGENTS.md` |
|
|
27
32
|
| `sc dev` | Starts the app from source |
|
|
28
33
|
| `sc start` | Starts the app in production-style mode |
|
|
29
34
|
| `sc build` | Builds the app |
|
|
30
35
|
| `sc lint` | Lints the app |
|
|
31
36
|
| `sc test` | Runs the test suite |
|
|
37
|
+
| `sc sync` | Syncs and validates `sculptor.packages.json` |
|
|
38
|
+
| `sc ls` / `sc list` | Prints the tree and package diagnostics |
|
|
39
|
+
| `sc pkg` / `sc package` | Prints package diagnostics |
|
|
32
40
|
| `sc config get <path>` | Reads a config value |
|
|
33
41
|
| `sc config set <path=value>` | Writes a config value |
|
|
34
42
|
| `sc config list` | Lists the merged config |
|
|
43
|
+
| `sc reg` / `sc register` / `sc r` | Registers a file in the package registry |
|
|
44
|
+
| `sc ureg` / `sc unreg` / `sc unregister` / `sc ur` | Unregisters a file from the package registry |
|
|
45
|
+
| `sc rm` / `sc remove` | Deletes a file and syncs the registry |
|
|
35
46
|
| `sc install deps` | Replays app dependency installs inside a Sculptor app |
|
|
36
47
|
| `sc i deps` | Alias for `sc install deps` |
|
|
37
|
-
| `sc update` | Updates globally installed Sculptor
|
|
48
|
+
| `sc update` | Updates the globally installed Sculptor CLI only |
|
|
49
|
+
| `sc doctor` | Runs project, registry, and compatibility diagnostics |
|
|
38
50
|
| `sc generate` / `sc g` | Generates framework resources |
|
|
39
51
|
| `sc g c user` | Generates a controller resource |
|
|
40
52
|
| `sc g r user` | Generates a functional route and handler pair |
|
|
53
|
+
| `sc g pkg user` | Generates a package index and package-local resources |
|
|
41
54
|
| `sc g c user in src/app/users` | Generates into a custom path |
|
|
42
55
|
| `sc g c in src/app/users` | Infers the name from the path and generates there |
|
|
43
56
|
| `sc g t user -e` | Generates an enum type file |
|
|
@@ -53,18 +66,20 @@ It handles:
|
|
|
53
66
|
- Temporary Execution (via Package Runner): `npx sc` or `npx sculptor`
|
|
54
67
|
- Programmatic API: `runCli()`
|
|
55
68
|
|
|
56
|
-
|
|
69
|
+
If `sc` conflicts with another command on your system, use `sculptor` instead.
|
|
57
70
|
|
|
58
71
|
## Command Reference
|
|
59
72
|
|
|
60
73
|
### `sc new <app>`
|
|
61
74
|
|
|
62
75
|
What it does:
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
76
|
+
|
|
77
|
+
- creates a new Sculptor app in a sibling folder
|
|
78
|
+
- writes the initial framework files
|
|
79
|
+
- installs the package dependencies
|
|
66
80
|
|
|
67
81
|
How it is used:
|
|
82
|
+
|
|
68
83
|
```bash
|
|
69
84
|
sc new my-app
|
|
70
85
|
```
|
|
@@ -87,506 +102,212 @@ Flags:
|
|
|
87
102
|
| `--tsx` | Shortcut for `tsx` dev server |
|
|
88
103
|
| `--nodemon` | Shortcut for `nodemon` dev server |
|
|
89
104
|
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
sc new api
|
|
93
|
-
sc new api --style=hybrid
|
|
94
|
-
sc new api --dev-server=nodemon
|
|
95
|
-
sc new api --framework-lock=false
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
What it solves:
|
|
99
|
-
- You get a ready-to-run app with the framework defaults already wired
|
|
105
|
+
### `sc agents` and `sc agents refresh`
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
- [packages/cli/src/cli.ts](src/cli.ts)
|
|
103
|
-
- [packages/cli/src/scaffold.ts](src/scaffold.ts)
|
|
104
|
-
- [packages/cli/src/runtime-dependencies.ts](src/runtime-dependencies.ts)
|
|
107
|
+
What they do:
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
- generate a concise `AGENTS.md`
|
|
110
|
+
- capture package-aware, registry-aware, DI-aware, and CLI-aware guidance for AI coding agents
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
- Starts the app from source
|
|
110
|
-
- Prints the CLI banner
|
|
112
|
+
Behavior:
|
|
111
113
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
sc dev --port=4000
|
|
116
|
-
```
|
|
114
|
+
- `sc agents` writes the file if it is missing
|
|
115
|
+
- `sc agents refresh` rewrites the file with the latest framework guidance
|
|
116
|
+
- both commands are safe to run repeatedly
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
### `sc dev`
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
| --- | --- |
|
|
122
|
-
| `--port=<number>` | Sets `PORT` for the dev process |
|
|
120
|
+
What it does:
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
-
|
|
122
|
+
- starts the app from source
|
|
123
|
+
- prints the CLI banner
|
|
126
124
|
|
|
127
125
|
Behavior:
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
126
|
+
|
|
127
|
+
- uses `nodemon` when `project.devServer` is `nodemon`
|
|
128
|
+
- uses `tsx` when `project.devServer` is `tsx`
|
|
129
|
+
- refuses to run outside a Sculptor app root
|
|
130
|
+
- suppresses the runtime banner by setting `SCULPTOR_SUPPRESS_BANNER=1`
|
|
132
131
|
|
|
133
132
|
### `sc start`
|
|
134
133
|
|
|
135
134
|
What it does:
|
|
136
|
-
- Starts the app in production-style mode
|
|
137
|
-
|
|
138
|
-
How it is used:
|
|
139
|
-
```bash
|
|
140
|
-
sc start
|
|
141
|
-
sc start --port=4000
|
|
142
|
-
sc start --watch
|
|
143
|
-
```
|
|
144
135
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
| Flag | Meaning |
|
|
148
|
-
| --- | --- |
|
|
149
|
-
| `--port=<number>` | Sets `PORT` for the process |
|
|
150
|
-
| `--watch` | Forces the dev path instead of the built path |
|
|
136
|
+
- starts the app in production-style mode
|
|
151
137
|
|
|
152
138
|
Behavior:
|
|
153
|
-
- If `dist/main.js` exists and `--watch` is not set, it runs the built app
|
|
154
|
-
- If `--watch` is set, it behaves like `sc dev`
|
|
155
|
-
- If no build output exists, it falls back to `tsx src/main.ts`
|
|
156
139
|
|
|
157
|
-
|
|
158
|
-
-
|
|
140
|
+
- if `dist/main.js` exists and `--watch` is not set, it runs the built app
|
|
141
|
+
- if `--watch` is set, it behaves like `sc dev`
|
|
142
|
+
- if no build output exists, it falls back to `tsx src/main.ts`
|
|
159
143
|
|
|
160
144
|
### `sc build`
|
|
161
145
|
|
|
162
146
|
What it does:
|
|
163
|
-
- Runs TypeScript build for the current app
|
|
164
|
-
|
|
165
|
-
How it is used:
|
|
166
|
-
```bash
|
|
167
|
-
sc build
|
|
168
|
-
```
|
|
169
147
|
|
|
170
|
-
|
|
171
|
-
-
|
|
172
|
-
|
|
173
|
-
Behavior:
|
|
174
|
-
- Only works inside a Sculptor app root
|
|
175
|
-
- Uses the app-local `tsconfig.json`
|
|
148
|
+
- runs TypeScript build for the current app
|
|
149
|
+
- runs package validation before TypeScript compile in the current release line
|
|
176
150
|
|
|
177
151
|
### `sc lint`
|
|
178
152
|
|
|
179
153
|
What it does:
|
|
180
|
-
- Runs ESLint from the app root
|
|
181
|
-
|
|
182
|
-
How it is used:
|
|
183
|
-
```bash
|
|
184
|
-
sc lint
|
|
185
|
-
```
|
|
186
154
|
|
|
187
|
-
|
|
188
|
-
- Gives a single framework-aligned lint command
|
|
155
|
+
- runs ESLint from the app root
|
|
189
156
|
|
|
190
157
|
### `sc test`
|
|
191
158
|
|
|
192
159
|
What it does:
|
|
193
|
-
- Runs the app test suite
|
|
194
160
|
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
sc test
|
|
198
|
-
```
|
|
161
|
+
- runs the app test suite
|
|
199
162
|
|
|
200
163
|
Behavior:
|
|
201
|
-
- If `src/tests/runner.spec.ts` exists, runs `vitest run src/tests/runner.spec.ts`
|
|
202
|
-
- If the runner does not exist, falls back to `vitest run`
|
|
203
164
|
|
|
204
|
-
|
|
205
|
-
-
|
|
165
|
+
- if `src/tests/runner.spec.ts` exists, it runs that entrypoint
|
|
166
|
+
- otherwise it falls back to `vitest run`
|
|
206
167
|
|
|
207
|
-
### `sc
|
|
168
|
+
### `sc sync`
|
|
208
169
|
|
|
209
170
|
What it does:
|
|
210
|
-
- Reads, writes, and lists app config
|
|
211
171
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
sc config get logging
|
|
215
|
-
sc config set logging.dogMode=false
|
|
216
|
-
sc config list
|
|
217
|
-
```
|
|
172
|
+
- validates and refreshes `sculptor.packages.json`
|
|
173
|
+
- checks package ownership, stale files, missing files, and registry consistency
|
|
218
174
|
|
|
219
175
|
Behavior:
|
|
220
|
-
- `get` reads a dot-path from the merged config
|
|
221
|
-
- `set` writes a dot-path assignment while preserving JSON formatting when possible
|
|
222
|
-
- `list` prints the flattened merged config
|
|
223
|
-
- `sculptor` supports the same command set as `sc`
|
|
224
176
|
|
|
225
|
-
|
|
177
|
+
- supports `-p`, `--p`, `-pkg`, `--pkg`, `-package`, and `--package`
|
|
178
|
+
- package targeting is exact and does not singularize or pluralize names
|
|
179
|
+
- warnings do not block the build path unless metadata is malformed or irrecoverable
|
|
226
180
|
|
|
227
|
-
|
|
228
|
-
- Replays the standard Sculptor app dependency installation sequence
|
|
229
|
-
- Runs inside an existing Sculptor app root
|
|
230
|
-
- Helps recover after an interrupted `npm i` during setup
|
|
181
|
+
### `sc ls` / `sc list`
|
|
231
182
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```
|
|
183
|
+
What they do:
|
|
184
|
+
|
|
185
|
+
- print package and tree diagnostics
|
|
186
|
+
- show registered files, missing files, and unregistered files
|
|
237
187
|
|
|
238
188
|
Behavior:
|
|
239
|
-
- Uses `npm i` for the app package.json dependencies first
|
|
240
|
-
- Installs the Sculptor runtime dependencies next
|
|
241
|
-
- Reinstalls the Sculptor CLI/config/router dev dependencies last
|
|
242
|
-
- Refuses to run outside a Sculptor app root
|
|
243
189
|
|
|
244
|
-
|
|
190
|
+
- `-t`, `--tree`, `-tree`, and `--t` enable tree output
|
|
191
|
+
- package targeting uses the same exact-name flags as `sc sync`
|
|
245
192
|
|
|
246
|
-
|
|
247
|
-
- Updates globally installed Sculptor packages to their latest versions
|
|
193
|
+
### `sc pkg` / `sc package`
|
|
248
194
|
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
sc update
|
|
252
|
-
```
|
|
195
|
+
What they do:
|
|
253
196
|
|
|
254
|
-
|
|
255
|
-
-
|
|
256
|
-
- Uses the active package manager when possible
|
|
257
|
-
- Updates the global Sculptor package set in one pass
|
|
197
|
+
- print package diagnostics
|
|
198
|
+
- show package path, index path, and tracked files
|
|
258
199
|
|
|
259
|
-
### `sc
|
|
200
|
+
### `sc reg` / `sc register` / `sc r`
|
|
260
201
|
|
|
261
|
-
What
|
|
262
|
-
- Generates framework resources in the current app
|
|
202
|
+
What they do:
|
|
263
203
|
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
sc generate controller user
|
|
267
|
-
sc g c user
|
|
268
|
-
```
|
|
204
|
+
- register a file in `sculptor.packages.json`
|
|
269
205
|
|
|
270
|
-
|
|
206
|
+
### `sc ureg` / `sc unreg` / `sc unregister` / `sc ur`
|
|
271
207
|
|
|
272
|
-
|
|
273
|
-
| --- | --- |
|
|
274
|
-
| controller | `c`, `controller` |
|
|
275
|
-
| service | `s`, `service` |
|
|
276
|
-
| module | `m`, `mo`, `module` |
|
|
277
|
-
| middleware | `mw`, `middleware` |
|
|
278
|
-
| type | `t`, `type` |
|
|
279
|
-
| route | `r`, `route`, `resource` |
|
|
208
|
+
What they do:
|
|
280
209
|
|
|
281
|
-
|
|
282
|
-
- Refuses to run outside a Sculptor app root
|
|
283
|
-
- Controller generation is controller-first by default and can opt into paired functional route files with `--functional`
|
|
284
|
-
- Route generation always writes the paired functional route and handler files
|
|
285
|
-
- Rewrites the test registry when test generation is enabled
|
|
210
|
+
- unregister a file from `sculptor.packages.json`
|
|
286
211
|
|
|
287
|
-
|
|
288
|
-
- Your app stays consistent as it grows
|
|
212
|
+
### `sc rm` / `sc remove`
|
|
289
213
|
|
|
290
|
-
|
|
214
|
+
What they do:
|
|
291
215
|
|
|
292
|
-
|
|
293
|
-
-
|
|
216
|
+
- delete a file
|
|
217
|
+
- sync the registry after removal
|
|
294
218
|
|
|
295
|
-
|
|
296
|
-
```bash
|
|
297
|
-
sc help
|
|
298
|
-
sc help generate
|
|
299
|
-
sc help controller
|
|
300
|
-
sc help module
|
|
301
|
-
sc help middleware
|
|
302
|
-
sc help type
|
|
303
|
-
sc help route
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### `sc version`
|
|
219
|
+
### `sc config`
|
|
307
220
|
|
|
308
221
|
What it does:
|
|
309
|
-
- Prints the CLI version and the banner
|
|
310
222
|
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
sc version
|
|
314
|
-
sc v
|
|
315
|
-
sc -v
|
|
316
|
-
sc --v
|
|
317
|
-
sc --version
|
|
318
|
-
```
|
|
223
|
+
- reads, writes, and lists app config
|
|
319
224
|
|
|
320
|
-
|
|
225
|
+
Behavior:
|
|
321
226
|
|
|
322
|
-
|
|
227
|
+
- `get` reads a dot-path from the merged config
|
|
228
|
+
- `set` writes a dot-path assignment while preserving JSON formatting when possible
|
|
229
|
+
- `list` prints the flattened merged config
|
|
230
|
+
- `sculptor` supports the same command set as `sc`
|
|
323
231
|
|
|
324
|
-
|
|
325
|
-
| --- | --- |
|
|
326
|
-
| `-v` | Print version |
|
|
327
|
-
| `--v` | Print version |
|
|
328
|
-
| `--version` | Print version |
|
|
329
|
-
| `version` | Print version |
|
|
330
|
-
| `v` | Print version |
|
|
331
|
-
| `-h` | Print help |
|
|
332
|
-
| `--help` | Print help |
|
|
232
|
+
### `sc install deps` and `sc i deps`
|
|
333
233
|
|
|
334
|
-
|
|
234
|
+
What it does:
|
|
335
235
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
| `--version` | Scaffold version |
|
|
340
|
-
| `--style` | Routing style |
|
|
341
|
-
| `--decorator` | Decorator routing shortcut |
|
|
342
|
-
| `--functional` | Functional routing shortcut |
|
|
343
|
-
| `--hybrid` | Hybrid routing shortcut |
|
|
344
|
-
| `--frameworkLock` | Framework lock |
|
|
345
|
-
| `--frameworklock` | Framework lock |
|
|
346
|
-
| `--framework-lock` | Framework lock |
|
|
347
|
-
| `--dev-server` | Dev server selection |
|
|
348
|
-
| `--devserver` | Dev server selection |
|
|
349
|
-
| `--tsx` | Dev server shortcut |
|
|
350
|
-
| `--nodemon` | Dev server shortcut |
|
|
351
|
-
|
|
352
|
-
### `sc dev` / `sc start` flags
|
|
236
|
+
- replays the standard Sculptor app dependency installation sequence
|
|
237
|
+
- runs inside an existing Sculptor app root
|
|
238
|
+
- helps recover after an interrupted `npm i` during setup
|
|
353
239
|
|
|
354
|
-
|
|
355
|
-
| --- | --- |
|
|
356
|
-
| `--port` | Sets the process port |
|
|
357
|
-
| `--watch` | Only used by `sc start` |
|
|
240
|
+
Behavior:
|
|
358
241
|
|
|
359
|
-
|
|
242
|
+
- uses `npm i` for the app package.json dependencies first
|
|
243
|
+
- installs the Sculptor runtime dependencies next
|
|
244
|
+
- reinstalls the Sculptor CLI/config/router dev dependencies last
|
|
245
|
+
- refuses to run outside a Sculptor app root
|
|
360
246
|
|
|
361
|
-
|
|
362
|
-
| --- | --- |
|
|
363
|
-
| `--functional` | Use functional routing mode |
|
|
364
|
-
| `--with-routes` | Alias for paired functional route generation |
|
|
365
|
-
| `--decorator` | Use decorator routing mode |
|
|
366
|
-
| `--hybrid` | Use hybrid routing mode |
|
|
367
|
-
| `--style` | Explicitly set routing mode |
|
|
368
|
-
| `in <path>` | Write files into a custom directory |
|
|
369
|
-
| `-i` | Type generator creates `*.interface.ts` |
|
|
370
|
-
| `-interface` | Type generator creates `*.interface.ts` |
|
|
371
|
-
| `-c` | Type generator creates `*.class.ts` |
|
|
372
|
-
| `-class` | Type generator creates `*.class.ts` |
|
|
373
|
-
| `-e` | Type generator creates `*.enum.ts` |
|
|
374
|
-
| `-enum` | Type generator creates `*.enum.ts` |
|
|
375
|
-
|
|
376
|
-
## Generator Behavior
|
|
377
|
-
|
|
378
|
-
### Controller generation
|
|
247
|
+
### `sc update`
|
|
379
248
|
|
|
380
249
|
What it does:
|
|
381
|
-
- Writes `*.controller.ts` by default
|
|
382
|
-
- Pass `--functional` or `--with-routes` to also write paired `*.route.ts` and `*.route.handler.ts` files
|
|
383
|
-
- In functional-first app flows, the paired functional route files are the standard route shape
|
|
384
|
-
|
|
385
|
-
Examples:
|
|
386
|
-
```bash
|
|
387
|
-
sc generate controller user
|
|
388
|
-
sc g c user
|
|
389
|
-
sc g c user in src/app/users
|
|
390
|
-
sc g c in src/app/users
|
|
391
|
-
sc g c user --functional
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
If you use `in <path>`:
|
|
395
|
-
- the file location changes to that path
|
|
396
|
-
- the file name still follows the generator suffix
|
|
397
|
-
- if you do not provide a name, the CLI infers it from the last path segment
|
|
398
|
-
- the generated test file, when enabled, is written under `src/tests`
|
|
399
250
|
|
|
400
|
-
|
|
251
|
+
- updates the globally installed Sculptor CLI package only
|
|
401
252
|
|
|
402
|
-
|
|
403
|
-
- Writes `*.service.ts`
|
|
253
|
+
How it is used:
|
|
404
254
|
|
|
405
|
-
Examples:
|
|
406
255
|
```bash
|
|
407
|
-
sc
|
|
408
|
-
sc g s user
|
|
409
|
-
sc g s user in src/app/services
|
|
256
|
+
sc update
|
|
410
257
|
```
|
|
411
258
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
What it does:
|
|
415
|
-
- Writes `*.module.ts`
|
|
259
|
+
Behavior:
|
|
416
260
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
sc g m user
|
|
421
|
-
sc g mo user
|
|
422
|
-
```
|
|
261
|
+
- only installs `@sculptor/cli`
|
|
262
|
+
- does not mutate runtime package dependencies globally
|
|
263
|
+
- remains separate from scaffold-time template-registry recovery
|
|
423
264
|
|
|
424
|
-
|
|
265
|
+
## Alias Notes
|
|
425
266
|
|
|
426
|
-
|
|
427
|
-
-
|
|
267
|
+
- `sc g` -> `sc generate`
|
|
268
|
+
- `pkg` -> `package`
|
|
269
|
+
- `ls` -> `list`
|
|
270
|
+
- `reg` -> `register`
|
|
271
|
+
- `ureg` -> `unreg` -> `unregister` -> `ur`
|
|
272
|
+
- `rm` -> `remove`
|
|
428
273
|
|
|
429
|
-
|
|
430
|
-
```bash
|
|
431
|
-
sc generate middleware auth
|
|
432
|
-
sc g mw auth
|
|
433
|
-
sc g mw auth in src/app/middlewares
|
|
434
|
-
```
|
|
274
|
+
## Package Target Flags
|
|
435
275
|
|
|
436
|
-
|
|
276
|
+
Package-targeting flags accept either `=value` or separate `value` forms:
|
|
437
277
|
|
|
438
|
-
|
|
439
|
-
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
278
|
+
- `-p`
|
|
279
|
+
- `--p`
|
|
280
|
+
- `-pkg`
|
|
281
|
+
- `--pkg`
|
|
282
|
+
- `-package`
|
|
283
|
+
- `--package`
|
|
444
284
|
|
|
445
285
|
Examples:
|
|
446
|
-
```bash
|
|
447
|
-
sc g t
|
|
448
|
-
sc generate type user
|
|
449
|
-
sc g t user
|
|
450
|
-
sc generate type user -interface
|
|
451
|
-
sc g t user -i
|
|
452
|
-
sc generate type user -class
|
|
453
|
-
sc g t user -c
|
|
454
|
-
sc generate type user -enum
|
|
455
|
-
sc g t user -e
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
If you omit the name, the CLI falls back to `index` unless a custom output path lets it infer a name from the directory.
|
|
459
286
|
|
|
460
|
-
### Route generation
|
|
461
|
-
|
|
462
|
-
What it does:
|
|
463
|
-
- Writes `*.route.ts` and `*.route.handler.ts`
|
|
464
|
-
- Uses the Sculptor functional router builder
|
|
465
|
-
- Generates a paired handler with try/catch and error middleware boilerplate
|
|
466
|
-
|
|
467
|
-
Examples:
|
|
468
287
|
```bash
|
|
469
|
-
sc
|
|
470
|
-
sc g
|
|
471
|
-
sc g
|
|
288
|
+
sc g pkg user -p=user
|
|
289
|
+
sc g pkg user --pkg user
|
|
290
|
+
sc g pkg user -package=user
|
|
291
|
+
sc ls -t --package user
|
|
472
292
|
```
|
|
473
293
|
|
|
474
|
-
##
|
|
294
|
+
## App Root Rule
|
|
475
295
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
| Setting | Result |
|
|
479
|
-
| --- | --- |
|
|
480
|
-
| `true` | Matching `*.spec.ts` files are generated |
|
|
481
|
-
| `false` | No new spec files are generated |
|
|
482
|
-
|
|
483
|
-
Generated spec names:
|
|
484
|
-
|
|
485
|
-
- `user.controller.spec.ts`
|
|
486
|
-
- `user.service.spec.ts`
|
|
487
|
-
- `user.route.spec.ts`
|
|
488
|
-
- `auth.middleware.spec.ts`
|
|
489
|
-
|
|
490
|
-
Default scaffold test files:
|
|
491
|
-
|
|
492
|
-
- `src/tests/main.spec.ts`
|
|
493
|
-
- `src/tests/health.controller.spec.ts`
|
|
494
|
-
- `src/tests/health.route.spec.ts`
|
|
495
|
-
- `src/tests/registry.ts`
|
|
496
|
-
- `src/tests/runner.ts`
|
|
497
|
-
- `src/tests/runner.spec.ts`
|
|
498
|
-
|
|
499
|
-
## Test Harness Behavior
|
|
500
|
-
|
|
501
|
-
What it does:
|
|
502
|
-
- Discovers every `*.spec.ts` file under `src/tests`
|
|
503
|
-
- Writes `src/tests/registry.ts`
|
|
504
|
-
- Writes `src/tests/runner.ts`
|
|
505
|
-
- Writes `src/tests/runner.spec.ts`
|
|
506
|
-
|
|
507
|
-
How it is used:
|
|
508
|
-
- `sc test` runs the registry runner when it exists
|
|
509
|
-
|
|
510
|
-
What it solves:
|
|
511
|
-
- You do not have to manually keep your test suite entrypoint updated
|
|
512
|
-
|
|
513
|
-
## App Root Rules
|
|
514
|
-
|
|
515
|
-
Only these commands work from outside a Sculptor app root:
|
|
296
|
+
The CLI only allows certain commands outside a Sculptor app root:
|
|
516
297
|
|
|
517
298
|
- `sc new`
|
|
299
|
+
- `sc agents`
|
|
300
|
+
- `sc agents refresh`
|
|
518
301
|
- `sc help`
|
|
519
302
|
- `sc version`
|
|
303
|
+
- `sc doctor`
|
|
520
304
|
- `sc update`
|
|
521
305
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
Everything else requires `sculptor.json` in the current directory.
|
|
525
|
-
|
|
526
|
-
If you try to run a restricted command outside an app root, the CLI stops with a clear error.
|
|
527
|
-
|
|
528
|
-
## CLI Banner Behavior
|
|
529
|
-
|
|
530
|
-
The version line in the banner is automatic.
|
|
531
|
-
|
|
532
|
-
If the package version changes, the banner version changes too.
|
|
533
|
-
|
|
534
|
-
## Programmatic Use
|
|
535
|
-
|
|
536
|
-
```ts
|
|
537
|
-
import { runCli } from "@sculptor/cli";
|
|
538
|
-
|
|
539
|
-
await runCli(["node", "sc", "help"]);
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
## Exports
|
|
543
|
-
|
|
544
|
-
`@sculptor/cli` re-exports:
|
|
545
|
-
|
|
546
|
-
- `runCli`
|
|
547
|
-
- `resolveProjectMetadata`
|
|
548
|
-
- `scaffoldProject`
|
|
549
|
-
- `generateResourceFiles`
|
|
550
|
-
- `writeGeneratedFiles`
|
|
551
|
-
- `syncTestHarness`
|
|
552
|
-
- the scaffold help strings
|
|
553
|
-
|
|
554
|
-
These generator helpers now resolve `@sculptor/template-registry` at runtime and can prompt to install it if the package is missing.
|
|
555
|
-
Call them with `await` when using the package programmatically.
|
|
556
|
-
|
|
557
|
-
## Package Scripts
|
|
558
|
-
|
|
559
|
-
- `npm run cli` runs the CLI source with `tsx`
|
|
560
|
-
- `npm run build` compiles the package
|
|
561
|
-
- `npm run prepack` builds before packaging
|
|
562
|
-
|
|
563
|
-
## Runtime Boundaries
|
|
564
|
-
|
|
565
|
-
- `@sculptor/template-registry` is a runtime dependency, not a dev-only helper
|
|
566
|
-
- the CLI loads it lazily so global installs can recover cleanly when the package is missing
|
|
567
|
-
- future plugin/template loaders should follow the same pattern: detect, explain, recover, then retry
|
|
568
|
-
- publish `@sculptor/template-registry` before `@sculptor/cli` so global installs never see a missing runtime dependency during rollout
|
|
569
|
-
|
|
570
|
-
## If You Only Remember One Thing
|
|
571
|
-
|
|
572
|
-
If you are inside a Sculptor app root, use:
|
|
573
|
-
|
|
574
|
-
```bash
|
|
575
|
-
sc dev
|
|
576
|
-
sc generate controller user
|
|
577
|
-
sc generate route user
|
|
578
|
-
sc config list
|
|
579
|
-
sc test
|
|
580
|
-
```
|
|
581
|
-
|
|
582
|
-
If you are outside an app root, only use:
|
|
583
|
-
|
|
584
|
-
```bash
|
|
585
|
-
sc new
|
|
586
|
-
sc help
|
|
587
|
-
sc version
|
|
588
|
-
```
|
|
306
|
+
The runtime commands require `sculptor.json` in the current app root.
|
|
589
307
|
|
|
590
|
-
|
|
308
|
+
Next:
|
|
591
309
|
|
|
592
|
-
|
|
310
|
+
- [packages/core/README.md](../core/README.md)
|
|
311
|
+
- [packages/di/README.md](../di/README.md)
|
|
312
|
+
- [packages/router/README.md](../router/README.md)
|
|
313
|
+
- [packages/template-registry/README.md](../template-registry/README.md)
|