@sdxc/kit 2026.10.17 → 2026.10.21

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 (295) hide show
  1. package/README.md +397 -22
  2. package/changelog.jsonl +1171 -1092
  3. package/config.schema.json +53 -1
  4. package/dist/cli.js +12 -0
  5. package/dist/commands/deploy.d.ts +23 -0
  6. package/dist/commands/deploy.js +167 -0
  7. package/dist/commands/destroy.d.ts +22 -0
  8. package/dist/commands/destroy.js +92 -0
  9. package/dist/commands/doctor.d.ts +26 -0
  10. package/dist/commands/doctor.js +65 -0
  11. package/dist/commands/initializers.d.ts +16 -0
  12. package/dist/commands/initializers.js +23 -0
  13. package/dist/commands/make.d.ts +78 -6
  14. package/dist/commands/make.js +134 -20
  15. package/dist/commands/middleware.d.ts +16 -0
  16. package/dist/commands/middleware.js +21 -0
  17. package/dist/commands/models.d.ts +18 -0
  18. package/dist/commands/models.js +29 -0
  19. package/dist/commands/notes.d.ts +17 -0
  20. package/dist/commands/notes.js +27 -0
  21. package/dist/commands/routes.d.ts +25 -0
  22. package/dist/commands/routes.js +50 -0
  23. package/dist/commands/run.d.ts +16 -0
  24. package/dist/commands/run.js +32 -11
  25. package/dist/commands/scaffold.d.ts +30 -0
  26. package/dist/commands/scaffold.js +34 -0
  27. package/dist/commands/schedule.d.ts +16 -0
  28. package/dist/commands/schedule.js +21 -0
  29. package/dist/commands/stats.d.ts +16 -0
  30. package/dist/commands/stats.js +21 -0
  31. package/dist/commands/ui/update.d.ts +6 -3
  32. package/dist/commands/ui/update.js +24 -7
  33. package/dist/commands/upgrade.d.ts +3 -1
  34. package/dist/commands/upgrade.js +88 -23
  35. package/dist/config.d.ts +20 -0
  36. package/dist/config.js +32 -1
  37. package/dist/contract.d.ts +101 -3
  38. package/dist/contract.js +371 -26
  39. package/dist/create/templates.js +3 -2
  40. package/dist/dependencies.d.ts +5 -1
  41. package/dist/dependencies.js +16 -1
  42. package/dist/deploy/plan.d.ts +49 -0
  43. package/dist/deploy/plan.js +68 -0
  44. package/dist/destroy.d.ts +40 -0
  45. package/dist/destroy.js +317 -0
  46. package/dist/doctor/check.d.ts +71 -0
  47. package/dist/doctor/check.js +53 -0
  48. package/dist/doctor/checks.d.ts +23 -0
  49. package/dist/doctor/checks.js +70 -0
  50. package/dist/doctor/define.d.ts +59 -0
  51. package/dist/doctor/define.js +16 -0
  52. package/dist/doctor/emails.d.ts +18 -0
  53. package/dist/doctor/emails.js +243 -0
  54. package/dist/doctor/env.d.ts +26 -0
  55. package/dist/doctor/env.js +88 -0
  56. package/dist/doctor/files.d.ts +14 -0
  57. package/dist/doctor/files.js +34 -0
  58. package/dist/doctor/fixture.d.ts +23 -0
  59. package/dist/doctor/fixture.js +46 -0
  60. package/dist/doctor/install.d.ts +17 -0
  61. package/dist/doctor/install.js +37 -0
  62. package/dist/doctor/installed.d.ts +11 -0
  63. package/dist/doctor/installed.js +79 -0
  64. package/dist/doctor/jsdoc.d.ts +44 -0
  65. package/dist/doctor/jsdoc.js +201 -0
  66. package/dist/doctor/layout.d.ts +23 -0
  67. package/dist/doctor/layout.js +83 -0
  68. package/dist/doctor/migrations.d.ts +16 -0
  69. package/dist/doctor/migrations.js +96 -0
  70. package/dist/doctor/models.d.ts +13 -0
  71. package/dist/doctor/models.js +69 -0
  72. package/dist/doctor/pins.d.ts +15 -0
  73. package/dist/doctor/pins.js +79 -0
  74. package/dist/doctor/project.d.ts +58 -0
  75. package/dist/doctor/project.js +261 -0
  76. package/dist/doctor/remix.d.ts +14 -0
  77. package/dist/doctor/remix.js +44 -0
  78. package/dist/doctor/routes.d.ts +11 -0
  79. package/dist/doctor/routes.js +49 -0
  80. package/dist/doctor/typegen.d.ts +13 -0
  81. package/dist/doctor/typegen.js +57 -0
  82. package/dist/doctor/ui.d.ts +14 -0
  83. package/dist/doctor/ui.js +51 -0
  84. package/dist/initializers.d.ts +25 -0
  85. package/dist/initializers.js +89 -0
  86. package/dist/lock.d.ts +2 -2
  87. package/dist/make/actions.d.ts +23 -0
  88. package/dist/make/actions.js +82 -0
  89. package/dist/make/declare.d.ts +31 -3
  90. package/dist/make/declare.js +284 -9
  91. package/dist/make/email.d.ts +23 -0
  92. package/dist/make/email.js +111 -0
  93. package/dist/make/from-fields.d.ts +30 -0
  94. package/dist/make/from-fields.js +162 -0
  95. package/dist/make/from-model.d.ts +39 -0
  96. package/dist/make/from-model.js +161 -0
  97. package/dist/make/generate.d.ts +25 -5
  98. package/dist/make/generate.js +76 -22
  99. package/dist/make/guard.d.ts +35 -0
  100. package/dist/make/guard.js +73 -0
  101. package/dist/make/imports.d.ts +6 -0
  102. package/dist/make/imports.js +19 -0
  103. package/dist/make/index.d.ts +49 -4
  104. package/dist/make/index.js +290 -29
  105. package/dist/make/kinds.d.ts +34 -2
  106. package/dist/make/kinds.js +92 -8
  107. package/dist/make/mount.d.ts +25 -0
  108. package/dist/make/mount.js +135 -0
  109. package/dist/make/schema-diff.d.ts +58 -0
  110. package/dist/make/schema-diff.js +609 -0
  111. package/dist/make/schema.d.ts +76 -0
  112. package/dist/make/schema.js +206 -0
  113. package/dist/make/stubs.d.ts +14 -7
  114. package/dist/make/stubs.js +24 -8
  115. package/dist/make/test.d.ts +43 -0
  116. package/dist/make/test.js +150 -0
  117. package/dist/make/trigger.d.ts +31 -0
  118. package/dist/make/trigger.js +163 -0
  119. package/dist/models.d.ts +42 -0
  120. package/dist/models.js +149 -0
  121. package/dist/notes.d.ts +28 -0
  122. package/dist/notes.js +66 -0
  123. package/dist/reference.d.ts +27 -0
  124. package/dist/reference.js +103 -0
  125. package/dist/releases.d.ts +9 -0
  126. package/dist/releases.js +29 -8
  127. package/dist/routes/chains.d.ts +34 -0
  128. package/dist/routes/chains.js +95 -0
  129. package/dist/routes/filter.d.ts +53 -0
  130. package/dist/routes/filter.js +147 -0
  131. package/dist/routes/format.d.ts +23 -0
  132. package/dist/routes/format.js +123 -0
  133. package/dist/routes/helpers.d.ts +21 -0
  134. package/dist/routes/helpers.js +165 -0
  135. package/dist/routes/index.d.ts +56 -0
  136. package/dist/routes/index.js +167 -0
  137. package/dist/routes/modules.d.ts +116 -0
  138. package/dist/routes/modules.js +235 -0
  139. package/dist/routes/parse.d.ts +161 -0
  140. package/dist/routes/parse.js +621 -0
  141. package/dist/routes/routers.d.ts +69 -0
  142. package/dist/routes/routers.js +327 -0
  143. package/dist/scaffold/fields.d.ts +129 -0
  144. package/dist/scaffold/fields.js +421 -0
  145. package/dist/scaffold/index.d.ts +39 -0
  146. package/dist/scaffold/index.js +622 -0
  147. package/dist/scaffold/render.d.ts +61 -0
  148. package/dist/scaffold/render.js +417 -0
  149. package/dist/schedule.d.ts +45 -0
  150. package/dist/schedule.js +124 -0
  151. package/dist/stats.d.ts +37 -0
  152. package/dist/stats.js +126 -0
  153. package/dist/ui/commands.d.ts +10 -3
  154. package/dist/ui/commands.js +85 -15
  155. package/dist/ui/registry.d.ts +8 -8
  156. package/dist/upgrade/agents.d.ts +49 -0
  157. package/dist/upgrade/agents.js +110 -0
  158. package/dist/upgrade/changelog.d.ts +2 -2
  159. package/dist/upgrade/project.d.ts +4 -0
  160. package/dist/upgrade/project.js +11 -1
  161. package/dist/upgrade/prompt.d.ts +11 -0
  162. package/dist/upgrade/prompt.js +50 -7
  163. package/package.json +6 -4
  164. package/registry/ui/alert-dialog.json +2 -2
  165. package/registry/ui/attachment.json +2 -2
  166. package/registry/ui/calendar.json +2 -2
  167. package/registry/ui/color-picker.json +2 -2
  168. package/registry/ui/command.json +2 -2
  169. package/registry/ui/date-picker.json +2 -2
  170. package/registry/ui/date-range-picker.json +2 -2
  171. package/registry/ui/dialog.json +2 -2
  172. package/registry/ui/file-trigger.json +2 -2
  173. package/registry/ui/heading-scope.json +2 -2
  174. package/registry/ui/message-scroller.json +2 -2
  175. package/registry/ui/number-field.json +2 -2
  176. package/registry/ui/range-calendar.json +2 -2
  177. package/registry/ui/resizable.json +2 -2
  178. package/registry/ui/select.json +2 -2
  179. package/registry/ui/shared-element.json +2 -2
  180. package/registry/ui/sidebar.json +3 -3
  181. package/registry/ui/typeset.json +3 -3
  182. package/stubs/command.spec.stub +15 -0
  183. package/stubs/controller.api.resource.stub +23 -0
  184. package/stubs/controller.api.spec.stub +15 -0
  185. package/stubs/controller.form.stub +2 -2
  186. package/stubs/controller.form.test.stub +2 -2
  187. package/stubs/controller.resource.form.stub +67 -0
  188. package/stubs/controller.resource.stub +28 -0
  189. package/stubs/controller.spec.stub +15 -0
  190. package/stubs/email.stub +9 -14
  191. package/stubs/email.test.stub +9 -9
  192. package/stubs/factory.stub +1 -1
  193. package/stubs/mcp.spec.stub +16 -0
  194. package/stubs/model.stub +3 -3
  195. package/stubs/policy.test.stub +34 -8
  196. package/stubs/scaffold.api.create.stub +34 -0
  197. package/stubs/scaffold.api.create.test.stub +37 -0
  198. package/stubs/scaffold.api.destroy.stub +34 -0
  199. package/stubs/scaffold.api.destroy.test.stub +44 -0
  200. package/stubs/scaffold.api.index.stub +23 -0
  201. package/stubs/scaffold.api.index.test.stub +31 -0
  202. package/stubs/scaffold.api.show.stub +27 -0
  203. package/stubs/scaffold.api.show.test.stub +41 -0
  204. package/stubs/scaffold.api.update.stub +44 -0
  205. package/stubs/scaffold.api.update.test.stub +46 -0
  206. package/stubs/scaffold.command.create.stub +22 -0
  207. package/stubs/scaffold.command.create.test.stub +30 -0
  208. package/stubs/scaffold.command.delete.stub +20 -0
  209. package/stubs/scaffold.command.delete.test.stub +39 -0
  210. package/stubs/scaffold.command.list.stub +18 -0
  211. package/stubs/scaffold.command.list.test.stub +31 -0
  212. package/stubs/scaffold.command.show.stub +19 -0
  213. package/stubs/scaffold.command.show.test.stub +37 -0
  214. package/stubs/scaffold.controller.destroy.stub +35 -0
  215. package/stubs/scaffold.controller.destroy.test.stub +65 -0
  216. package/stubs/scaffold.controller.edit.stub +97 -0
  217. package/stubs/scaffold.controller.edit.test.stub +91 -0
  218. package/stubs/scaffold.controller.index.stub +55 -0
  219. package/stubs/scaffold.controller.index.test.stub +32 -0
  220. package/stubs/scaffold.controller.new.stub +70 -0
  221. package/stubs/scaffold.controller.new.test.stub +81 -0
  222. package/stubs/scaffold.controller.show.stub +59 -0
  223. package/stubs/scaffold.controller.show.test.stub +43 -0
  224. package/stubs/scaffold.factory.stub +16 -0
  225. package/stubs/scaffold.form.stub +75 -0
  226. package/stubs/scaffold.mcp.create.stub +24 -0
  227. package/stubs/scaffold.mcp.create.test.stub +36 -0
  228. package/stubs/scaffold.mcp.delete.stub +31 -0
  229. package/stubs/scaffold.mcp.delete.test.stub +43 -0
  230. package/stubs/scaffold.mcp.get.stub +21 -0
  231. package/stubs/scaffold.mcp.get.test.stub +31 -0
  232. package/stubs/scaffold.mcp.list.stub +23 -0
  233. package/stubs/scaffold.mcp.list.test.stub +25 -0
  234. package/stubs/scaffold.mcp.update.stub +37 -0
  235. package/stubs/scaffold.mcp.update.test.stub +40 -0
  236. package/stubs/scaffold.migration.stub +3 -0
  237. package/stubs/scaffold.model.stub +35 -0
  238. package/stubs/scaffold.model.test.stub +25 -0
  239. package/stubs/scaffold.spec.stub +7 -0
  240. package/stubs/scaffold.test-database.stub +33 -0
  241. package/stubs/scaffold.test-mcp.stub +92 -0
  242. package/stubs/scaffold.validator.stub +18 -0
  243. package/stubs/scaffold.validator.test.stub +26 -0
  244. package/templates/app/AGENTS.md +167 -0
  245. package/templates/app/CLAUDE.md +1 -0
  246. package/templates/app/README.md +33 -15
  247. package/templates/app/app/commands/console.test.ts +26 -0
  248. package/templates/app/app/commands/console.ts +19 -0
  249. package/templates/app/app/commands/db/fresh.test.ts +57 -0
  250. package/templates/app/app/commands/db/fresh.ts +37 -0
  251. package/templates/app/app/commands/db/migrate.test.ts +17 -1
  252. package/templates/app/app/commands/db/migrate.ts +51 -18
  253. package/templates/app/app/commands/db/prepare.test.ts +39 -0
  254. package/templates/app/app/commands/db/prepare.ts +35 -0
  255. package/templates/app/app/commands/db/seed.test.ts +38 -0
  256. package/templates/app/app/commands/db/seed.ts +26 -0
  257. package/templates/app/app/commands/deploy.test.ts +34 -0
  258. package/templates/app/app/commands/deploy.ts +18 -0
  259. package/templates/app/app/commands/emails/preview.test.tsx +63 -0
  260. package/templates/app/app/commands/emails/preview.ts +24 -0
  261. package/templates/app/app/commands/index.ts +57 -2
  262. package/templates/app/app/commands/typegen.test.ts +20 -1
  263. package/templates/app/app/commands/typegen.ts +16 -2
  264. package/templates/app/app/emails/index.ts +10 -0
  265. package/templates/app/app/http/middleware/access.test.ts +43 -0
  266. package/templates/app/app/http/middleware/access.ts +41 -0
  267. package/templates/app/app/http/middleware/api.ts +12 -3
  268. package/templates/app/app/http/middleware/page.test.ts +4 -1
  269. package/templates/app/app/http/middleware/page.ts +7 -5
  270. package/templates/app/app/initializers/cli.ts +35 -2
  271. package/templates/app/app/initializers/dispatcher.ts +9 -1
  272. package/templates/app/app/initializers/mail-transport.test.ts +33 -0
  273. package/templates/app/app/initializers/mail-transport.ts +26 -0
  274. package/templates/app/app/initializers/mail.test.ts +17 -17
  275. package/templates/app/app/initializers/mail.ts +15 -7
  276. package/templates/app/app/initializers/router.test.ts +7 -0
  277. package/templates/app/app/initializers/router.tsx +13 -3
  278. package/templates/app/app/jobs/email.test.tsx +70 -0
  279. package/templates/app/app/jobs/email.ts +16 -0
  280. package/templates/app/app/jobs/index.ts +6 -2
  281. package/templates/app/app/policies/abilities.ts +13 -0
  282. package/templates/app/app/policies/policy.test.ts +15 -0
  283. package/templates/app/app/policies/policy.ts +30 -0
  284. package/templates/app/app/services/commands.ts +30 -0
  285. package/templates/app/app/services/migrations.test.ts +48 -1
  286. package/templates/app/app/services/migrations.ts +66 -9
  287. package/templates/app/app/test/cloudflare-workers.ts +2 -0
  288. package/templates/app/app/test/local-database.ts +67 -0
  289. package/templates/app/app/test/session.ts +28 -0
  290. package/templates/app/bootstrap/console.ts +13 -0
  291. package/templates/app/cloudflare.config.ts +3 -3
  292. package/templates/app/database/seed.ts +12 -0
  293. package/templates/app/package.json +3 -1
  294. package/templates/app/spec/config.jsonc +16 -0
  295. package/stubs/policy.stub +0 -16
package/README.md CHANGED
@@ -14,11 +14,24 @@ The package installs a command named `sdxc`. It works on projects that depend on
14
14
 
15
15
  ```sh
16
16
  sdxc create my-app # a Remix v3 app, or --template org/repo from GitHub
17
- sdxc make controller posts/show # a file where the app layout puts it, with its test
18
- sdxc make controller api/keys --routes api # a JSON endpoint in the API contract
17
+ sdxc make controller posts/show # a file where the app layout puts it, with its test and .spec
18
+ sdxc make controller api/keys --routes api # a JSON endpoint and an http .spec
19
+ sdxc make middleware require-user --mount page # called last in the page chain
20
+ sdxc make model post title author_id # the model, its migration and its factory
21
+ sdxc make migration add-slug-to-posts 'slug?' # ALTER TABLE, read from the name
22
+ sdxc make migration add-slug --from-model post # the SQL app/models/post.ts needs
23
+ sdxc scaffold post title body published_at # types follow the names: text, timestamp
24
+ sdxc scaffold post title body --api # JSON endpoints, OpenAPI ops and one feature .spec
25
+ sdxc destroy controller posts/show # remove it, its .spec, its mapping and its declaration
26
+ sdxc models post # the table app/models/post.ts declares, vs the migrations
19
27
  sdxc ui add dialog # copy a component into the project to edit it
28
+ sdxc ui update --all # move every unedited copy to the installed @sdxc/ui
20
29
  sdxc upgrade # move to the latest release and print a prompt for the code
30
+ sdxc doctor # report release drift, missing secrets and app-layout slips
31
+ sdxc routes --json # every route, its controller and middleware, for an agent
32
+ sdxc routes -g posts --method post # narrow it, as rails routes does; --unused, -c, -E too
21
33
  sdxc run users find ada@example.com # run the app's own command line, bootstrap/cli.ts
34
+ sdxc deploy # build, then the app's db migrate --remote and deploy
22
35
  ```
23
36
 
24
37
  On a terminal each command asks for what you left out; every question has a flag, so scripts and agents never wait on one.
@@ -30,37 +43,399 @@ Every `@sdxc/*` package versions as the UTC date it was published, and a daily r
30
43
  - `sdxc create` pins each package the template lists to its `latest` version.
31
44
  - `sdxc make` and `sdxc ui add` add a package the written code imports at the project's release, and print the install command to run.
32
45
  - `sdxc upgrade [release]` moves every `@sdxc/*` package the project lists to the target release, latest when left out, and `remix` to the version that release requires, then installs and prints a prompt for an AI agent from that release's changelog.
46
+ - `sdxc doctor` reports packages pinned behind the project's release and a `remix` pin other than the release's peer; `sdxc upgrade <release>` fixes both.
47
+
48
+ `sdxc doctor` also checks secrets, migrations, the app layout and JSDoc comment shape, and runs a project's own checks written with `defineCheck` from `@sdxc/kit/doctor`. The [doctor guide](https://sdxc.dev/docs/sdxc/check-a-project) lists every check.
33
49
 
34
50
  ## API
35
51
 
36
52
  ### Commands
37
53
 
38
- | Command | What it does |
39
- | -------------- | ------------------------------------------------------------------------------- |
40
- | `sdxc create` | Writes a new project from the built-in `app` template or a GitHub repository |
41
- | `sdxc init` | Writes `.config/sdxc.jsonc` with every key at its default |
42
- | `sdxc run` | Runs the app's own command line, `bootstrap/cli.ts`, with the project's runtime |
43
- | `sdxc make` | Writes a controller, job, model, migration or other file, declared and mapped |
44
- | `sdxc ui` | Copies `@sdxc/ui` components into the project and points imports at the copies |
45
- | `sdxc upgrade` | Moves the `@sdxc/*` packages and `remix` to a release and prints the prompt |
54
+ | Command | What it does |
55
+ | ------------------- | --------------------------------------------------------------------------------------- |
56
+ | `sdxc create` | Writes a new project from the built-in `app` template or a GitHub repository |
57
+ | `sdxc init` | Writes `.config/sdxc.jsonc` with every key at its default |
58
+ | `sdxc make` | Writes a controller, job, model, migration or other file, declared and mapped |
59
+ | `sdxc scaffold` | Writes a resource's model, migration, pages or JSON endpoints, and tests |
60
+ | `sdxc destroy` | Removes what `sdxc make` wrote, its mapping and its declaration, once confirmed |
61
+ | `sdxc routes` | Prints every route with its controller and middleware |
62
+ | `sdxc models` | Prints each model's table and whether the migrations create it |
63
+ | `sdxc schedule` | Lists scheduled jobs, their next runs and the Worker triggers that fire them |
64
+ | `sdxc middleware` | Prints each router's global middleware and every chain in `app/http/middleware` |
65
+ | `sdxc initializers` | Lists the initializers, their exports and the factories that build them |
66
+ | `sdxc notes` | Lists the `TODO`, `FIXME`, `HACK` and `OPTIMIZE` comments in the app's code |
67
+ | `sdxc stats` | Counts lines of code per kind of code, and the code to test ratio |
68
+ | `sdxc run` | Runs the app's own command line, `bootstrap/cli.ts`, with the project's runtime |
69
+ | `sdxc doctor` | Lints the project: release drift, secrets, migrations, layout, JSDoc and its own checks |
70
+ | `sdxc ui` | Copies `@sdxc/ui` components into the project and points imports at the copies |
71
+ | `sdxc upgrade` | Moves the `@sdxc/*` packages and `remix` to a release and prints the prompt |
72
+ | `sdxc deploy` | Builds, then runs the app's own `db migrate --remote` and `deploy`, once confirmed |
73
+
74
+ Commands run from the project root, the nearest directory with a `package.json`. `sdxc <command> --help` prints a command's arguments and flags, and `--help --json` prints them as data for an agent. Every command that runs tasks also takes `--no-progress`.
75
+
76
+ #### `sdxc create [directory]`
77
+
78
+ Write a new project from a built-in template or a GitHub repository
79
+
80
+ | Flag | Does |
81
+ | ----------------------- | -------------------------------------------------------------------- |
82
+ | `--template <template>` | A built-in template, or a GitHub repository as org/repo[/path][#ref] |
83
+ | `--git` | Initialize a git repository without asking, or skip it with --no-git |
84
+
85
+ #### `sdxc deploy`
86
+
87
+ Build, then run the app's db migrate --remote and deploy commands
88
+
89
+ | Flag | Does |
90
+ | --------------- | ---------------------------------------------------------- |
91
+ | `-y, --yes` | Deploy without asking; required without a terminal |
92
+ | `--dry-run` | Build and print the plan; migrate and deploy nothing |
93
+ | `--skip <step>` | Leave out build, migrate or deploy; repeat it or list them |
94
+
95
+ #### `sdxc destroy <kind> <name>`
96
+
97
+ Remove a file sdxc make wrote, its test, its pairing .spec, its mapping and its declaration
98
+
99
+ | Flag | Does |
100
+ | ------------ | ----------------------------------------------------------- |
101
+ | `-y, --yes` | Remove without asking; required without a terminal |
102
+ | `--dry-run` | Print what would be written and change nothing |
103
+ | `--resource` | With mcp, a resource in app/mcp/resources instead of a tool |
104
+
105
+ #### `sdxc doctor`
106
+
107
+ Lint release drift, secrets, migrations, app layout and project checks
108
+
109
+ | Flag | Does |
110
+ | ---------------- | ------------------------------------- |
111
+ | `--json` | Print the report as JSON for an agent |
112
+ | `--only <check>` | Run only the named checks |
113
+ | `--skip <check>` | Leave out the named checks |
114
+
115
+ #### `sdxc init`
116
+
117
+ Write .config/sdxc.jsonc with every default spelled out
118
+
119
+ | Flag | Does |
120
+ | ----------- | -------------------------- |
121
+ | `--dry-run` | Print it and write nothing |
122
+
123
+ #### `sdxc initializers`
124
+
125
+ List the initializers in app/initializers, their exports and what builds them
126
+
127
+ | Flag | Does |
128
+ | -------- | ------------------------------------- |
129
+ | `--json` | Print a JSON array instead of a table |
130
+
131
+ #### `sdxc make <kind> <name>`
132
+
133
+ Write a controller, job, model or other file where the app layout puts it
134
+
135
+ | Flag | Does |
136
+ | ----------- | ------------------------------------------------------------------------------------------- |
137
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
138
+ | `--dry-run` | Print what would be written and change nothing |
139
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
140
+
141
+ #### `sdxc make controller <name>`
142
+
143
+ A route handler in app/http/controllers, declared and mapped
144
+
145
+ | Flag | Does |
146
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
+ | `--method <method>` | get, post, put, patch, delete, form; asked on a terminal (default: get) |
148
+ | `--path <path>` | The route's pattern (default: /&lt;name&gt;) |
149
+ | `--routes <contract>` | The route contract in routes/ (default: make.routes) |
150
+ | `--resource <name>` | Check the resource's ability the method implies (get reads, form and post create, put and patch update, delete deletes); a read, update or delete route takes /&lt;name&gt;/:id |
151
+ | `--actions <action>` | One controller per action under &lt;name&gt;: index, new, show, edit and destroy pages, or with --routes api index, show, create, update and destroy endpoints; all writes each |
152
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
153
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
154
+ | `--dry-run` | Print what would be written and change nothing |
155
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
156
+
157
+ #### `sdxc make middleware <name>`
158
+
159
+ A middleware in app/http/middleware
160
+
161
+ | Flag | Does |
162
+ | ------------------ | ------------------------------------------------------------------------------------------- |
163
+ | `--mount <target>` | Also call it last in a chain: a router initializer (router) or a chain module (page, api) |
164
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
165
+ | `--dry-run` | Print what would be written and change nothing |
166
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
167
+
168
+ #### `sdxc make validator <name>`
169
+
170
+ An input validator in app/http/validators
171
+
172
+ | Flag | Does |
173
+ | ----------- | ------------------------------------------------------------------------------------------- |
174
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
175
+ | `--dry-run` | Print what would be written and change nothing |
176
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
177
+
178
+ #### `sdxc make job <name>`
179
+
180
+ A background job in app/jobs, declared and mapped
181
+
182
+ | Flag | Does |
183
+ | --------------------- | ------------------------------------------------------------------------------------------- |
184
+ | `--cron <expression>` | A scheduled job instead of one with input, with the Worker trigger that fires it |
185
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
186
+ | `--dry-run` | Print what would be written and change nothing |
187
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
188
+
189
+ #### `sdxc make model <name> [field[:type][?]...]`
190
+
191
+ A model in app/models, with the migration creating its table and its factory
192
+
193
+ | Flag | Does |
194
+ | ----------------- | ------------------------------------------------------------------------------------------- |
195
+ | `--chain <chain>` | The chain in make.migrations the migration goes in (default: default) |
196
+ | `--skip <file>` | Leave out the migration or the factory; repeat it or list them |
197
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
198
+ | `--dry-run` | Print what would be written and change nothing |
199
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
200
+
201
+ #### `sdxc make migration <name> [field[:type][?]...]`
202
+
203
+ A numbered SQL migration in a configured chain
204
+
205
+ | Flag | Does |
206
+ | ---------------------- | ---------------------------------------------------------------------------- |
207
+ | `--chain <chain>` | The chain in make.migrations (default: default) |
208
+ | `--from-model <model>` | Write the SQL that brings the chain in step with app/models/&lt;model&gt;.ts |
209
+ | `--dry-run` | Print what would be written and change nothing |
210
+
211
+ #### `sdxc make factory <name>`
212
+
213
+ A test factory in database/factories
214
+
215
+ | Flag | Does |
216
+ | ----------- | ------------------------------------------------------------------------------------------- |
217
+ | `--dry-run` | Print what would be written and change nothing |
218
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
219
+
220
+ #### `sdxc make service <name>`
221
+
222
+ A service in app/services
223
+
224
+ | Flag | Does |
225
+ | ----------- | ------------------------------------------------------------------------------------------- |
226
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
227
+ | `--dry-run` | Print what would be written and change nothing |
228
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
229
+
230
+ #### `sdxc make policy <name>`
231
+
232
+ A resource's create, read, update and delete abilities in app/policies, with their test
233
+
234
+ | Flag | Does |
235
+ | ----------- | ------------------------------------------------------------------------------------------- |
236
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
237
+ | `--dry-run` | Print what would be written and change nothing |
238
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
239
+
240
+ #### `sdxc make initializer <name>`
241
+
242
+ An initializer in app/initializers
243
+
244
+ | Flag | Does |
245
+ | ----------- | ------------------------------------------------------------------------------------------- |
246
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
247
+ | `--dry-run` | Print what would be written and change nothing |
248
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
249
+
250
+ #### `sdxc make email <name> [field[:type][?]...]`
251
+
252
+ An email template in app/emails, its props declared and the template mapped
253
+
254
+ | Flag | Does |
255
+ | ----------- | ------------------------------------------------------------------------------------------- |
256
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
257
+ | `--dry-run` | Print what would be written and change nothing |
258
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
259
+
260
+ #### `sdxc make mcp <name>`
261
+
262
+ An MCP tool in app/mcp/tools, or a resource, declared and mapped
263
+
264
+ | Flag | Does |
265
+ | ------------ | ------------------------------------------------------------------------------------------- |
266
+ | `--resource` | A resource in app/mcp/resources instead of a tool |
267
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
268
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
269
+ | `--dry-run` | Print what would be written and change nothing |
270
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
271
+
272
+ #### `sdxc make command <name>`
273
+
274
+ A command-line command in app/commands, declared and mapped
275
+
276
+ | Flag | Does |
277
+ | ----------- | ------------------------------------------------------------------------------------------- |
278
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
279
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
280
+ | `--dry-run` | Print what would be written and change nothing |
281
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
282
+
283
+ #### `sdxc make test <file>`
284
+
285
+ The test make writes beside a file, for an existing file without one
286
+
287
+ | Flag | Does |
288
+ | ----------- | ---------------------------------------------- |
289
+ | `--dry-run` | Print what would be written and change nothing |
290
+ | `--force` | Replace the test when it exists |
291
+
292
+ #### `sdxc make stubs [kind...]`
293
+
294
+ Copy the built-in stubs into make.stubs to edit
295
+
296
+ #### `sdxc middleware`
297
+
298
+ Print each router's global middleware and every chain in app/http/middleware
299
+
300
+ | Flag | Does |
301
+ | -------- | ------------------------ |
302
+ | `--json` | Print the chains as JSON |
303
+
304
+ #### `sdxc models [model...]`
305
+
306
+ Print each model's table and whether the migrations create it, from app/models
307
+
308
+ | Flag | Does |
309
+ | -------- | ------------------------ |
310
+ | `--json` | Print the models as JSON |
311
+
312
+ #### `sdxc notes`
313
+
314
+ List the TODO, FIXME, HACK and OPTIMIZE comments in the app's code
315
+
316
+ | Flag | Does |
317
+ | ------------- | ------------------------------------------------------------------------------- |
318
+ | `--tag <tag>` | The tags to list instead of TODO, FIXME, HACK, OPTIMIZE; repeat it or list them |
319
+ | `--json` | Print a JSON array instead of a list |
320
+
321
+ #### `sdxc routes`
322
+
323
+ Print every route with its controller and the middleware that runs for it
324
+
325
+ | Flag | Does |
326
+ | ------------------------- | ------------------------------------------------------------------------------ |
327
+ | `--json` | Print a JSON array instead of a table |
328
+ | `-E, --expanded` | Print one block per route with every field, for a narrow terminal |
329
+ | `-g, --grep <pattern>` | Keep routes whose name, pattern, method or controller matches |
330
+ | `-c, --controller <path>` | Keep routes of a controller file or folder, as posts or posts/show |
331
+ | `--method <method>` | Keep routes answering a method; ANY routes answer every one |
332
+ | `--contract <contract>` | Keep routes declared in a contract in routes/, as web |
333
+ | `--unused` | Keep routes no router maps, and report controllers no route maps |
334
+ | `--except-path <path>` | Leave out routes under a path, as /api or /mcp; repeat it or list them |
335
+ | `--sort <field>` | Order routes by name, pattern, method, controller instead of declaration order |
336
+
337
+ #### `sdxc run [command...]`
338
+
339
+ Run the project's own command line, bootstrap/cli.ts, with its runtime
340
+
341
+ #### `sdxc scaffold <name> [field[:type][?]...]`
342
+
343
+ Write a resource's model, migration, pages, tests and more, declared and mapped
344
+
345
+ | Flag | Does |
346
+ | ----------------- | --------------------------------------------------------------------------------------------------------------------- |
347
+ | `--plural <word>` | The plural the table, URLs and folders take (default: &lt;name&gt;s) |
348
+ | `--mcp` | Also write MCP tools to list, get, create, update and delete |
349
+ | `--command` | Also write app commands to list, show, create and delete |
350
+ | `--api` | JSON endpoints in routes/api.ts with their OpenAPI operations, instead of pages |
351
+ | `--skip <piece>` | Leave out pieces the project already has: model, migration, factory, validator, policy, pages; repeat it or list them |
352
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
353
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
354
+ | `--dry-run` | Print what would be written and change nothing |
355
+
356
+ #### `sdxc schedule`
357
+
358
+ List the scheduled jobs, their next runs and the Worker triggers that fire them
359
+
360
+ | Flag | Does |
361
+ | -------- | -------------------------- |
362
+ | `--json` | Print the schedule as JSON |
363
+
364
+ #### `sdxc stats`
365
+
366
+ Count lines of code per kind of code the app layout names, and the test ratio
367
+
368
+ | Flag | Does |
369
+ | -------- | ------------------------ |
370
+ | `--json` | Print the counts as JSON |
371
+
372
+ #### `sdxc ui list`
373
+
374
+ Every component, marking copies that are edited or behind
375
+
376
+ #### `sdxc ui add [component...]`
377
+
378
+ Copy components and point the project's imports at the copies
379
+
380
+ | Flag | Does |
381
+ | ------------- | --------------------------------------------------- |
382
+ | `--with-deps` | Also copy every component they reach through others |
383
+ | `--dry-run` | Print what would be written and change nothing |
384
+
385
+ #### `sdxc ui diff <component>`
386
+
387
+ Show how a copy differs from the installed version
388
+
389
+ #### `sdxc ui update [component...]`
390
+
391
+ Replace copied files with the installed version
392
+
393
+ | Flag | Does |
394
+ | ------------- | ----------------------------------------------------------------- |
395
+ | `--all` | Update every copy, leaving edited files unless --force |
396
+ | `--with-deps` | Also copy components the new versions reach and the project lacks |
397
+ | `--force` | Replace edited files without asking |
398
+ | `--dry-run` | Print what would be written and change nothing |
399
+
400
+ #### `sdxc ui remove [component...]`
401
+
402
+ Delete copies and point imports back at @sdxc/ui/&lt;name&gt;
403
+
404
+ | Flag | Does |
405
+ | ----------- | ---------------------------------------------- |
406
+ | `--dry-run` | Print what would be written and change nothing |
407
+
408
+ #### `sdxc upgrade [version]`
409
+
410
+ Move the @sdxc packages to another release and print the prompt for the code
46
411
 
47
- `sdxc <command> --help` lists each command's arguments and flags. Commands run from the project root, the nearest directory with a `package.json`.
412
+ | Flag | Does |
413
+ | --------------------------- | -------------------------------------------------------------------------------------- |
414
+ | `--no-install` | Change package.json only and print the commands to run next |
415
+ | `--output <file>` | Write the prompt to a file instead of stdout |
416
+ | `--prompt` | Print the prompt for this release of @sdxc/kit only; needs --from |
417
+ | `--from <version>` | The release the project moved from, with --prompt |
418
+ | `--since <package@version>` | A package's own pinned release when it lagged behind --from, with --prompt; repeatable |
419
+ | `--remix-from <version>` | The remix version the project moved from, with --prompt |
48
420
 
49
421
  ### Configuration
50
422
 
51
423
  The CLI reads `.config/sdxc.jsonc` (or `sdxc.jsonc` at the project root). Every key is optional.
52
424
 
53
- | Key | Default | Meaning |
54
- | ----------------- | -------------------------------------- | ---------------------------------------------------------------------------- |
55
- | `ui.directory` | `resources/components/ui` | Where `sdxc ui add` writes components |
56
- | `ui.alias` | inferred from tsconfig `paths` | Import prefix for the copies |
57
- | `ui.tests` | `false` | Copy a component's tests beside it |
58
- | `make.routes` | `web` | Route contract `sdxc make controller` adds to, a module in `routes/` |
59
- | `make.migrations` | `{ "default": "database/migrations" }` | Migration chains by name |
60
- | `make.tests` | `true` | Write a test beside every generated file except migrations and factories |
61
- | `make.stubs` | `.config/sdxc/stubs` | Stubs that replace the built-in ones |
62
- | `format` | none | Command run once on every file a command wrote or edited, the paths appended |
63
- | `lock` | `.config/sdxc.lock.jsonl` | Where the CLI keeps its state |
425
+ | Key | Default | Meaning |
426
+ | -------------------------- | -------------------------------------- | ---------------------------------------------------------------------------- |
427
+ | `ui.directory` | `resources/components/ui` | Where `sdxc ui add` writes components |
428
+ | `ui.alias` | inferred from tsconfig `paths` | Import prefix for the copies |
429
+ | `ui.tests` | `false` | Copy a component's tests beside it |
430
+ | `make.routes` | `web` | Route contract `sdxc make controller` adds to, a module in `routes/` |
431
+ | `make.migrations` | `{ "default": "database/migrations" }` | Migration chains by name |
432
+ | `make.tests` | `true` | Write a test beside every generated file except migrations and factories |
433
+ | `make.specs` | `true` | Write a pairing `.spec` for controllers, commands, MCP tools and scaffolds |
434
+ | `make.stubs` | `.config/sdxc/stubs` | Stubs that replace the built-in ones |
435
+ | `doctor.checks` | `.config/sdxc/checks` | The project's own `sdxc doctor` checks, one module each |
436
+ | `doctor.migrations.accept` | `[]` | Migration errors `sdxc doctor` steps past, each `{ "file", "column" }` |
437
+ | `format` | none | Command run once on every file a command wrote or edited, the paths appended |
438
+ | `lock` | `.config/sdxc.lock.jsonl` | Where the CLI keeps its state |
64
439
 
65
440
  `format` is an argument list, such as `["bunx", "vp", "fmt"]`.
66
441