@sdxc/kit 2026.10.20 → 2026.10.23

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 (138) hide show
  1. package/README.md +178 -93
  2. package/changelog.jsonl +97 -0
  3. package/config.schema.json +160 -0
  4. package/dist/architecture/complexity.d.ts +73 -0
  5. package/dist/architecture/complexity.js +185 -0
  6. package/dist/architecture/crap.d.ts +62 -0
  7. package/dist/architecture/crap.js +121 -0
  8. package/dist/architecture/graph.d.ts +55 -0
  9. package/dist/architecture/graph.js +194 -0
  10. package/dist/architecture/layers.d.ts +29 -0
  11. package/dist/architecture/layers.js +81 -0
  12. package/dist/architecture/mermaid.d.ts +20 -0
  13. package/dist/architecture/mermaid.js +51 -0
  14. package/dist/cli.js +9 -0
  15. package/dist/commands/create.js +4 -3
  16. package/dist/commands/deploy.js +10 -9
  17. package/dist/commands/destroy.d.ts +1 -1
  18. package/dist/commands/diagram.d.ts +17 -0
  19. package/dist/commands/diagram.js +45 -0
  20. package/dist/commands/fix.d.ts +69 -0
  21. package/dist/commands/fix.js +102 -0
  22. package/dist/commands/make.d.ts +77 -2
  23. package/dist/commands/make.js +53 -1
  24. package/dist/commands/run.d.ts +15 -11
  25. package/dist/commands/run.js +21 -16
  26. package/dist/commands/scaffold.d.ts +2 -1
  27. package/dist/commands/scaffold.js +1 -0
  28. package/dist/commands/setup.d.ts +26 -0
  29. package/dist/commands/setup.js +33 -0
  30. package/dist/config.d.ts +54 -0
  31. package/dist/config.js +92 -1
  32. package/dist/contract.d.ts +56 -3
  33. package/dist/contract.js +140 -7
  34. package/dist/dependencies.d.ts +2 -1
  35. package/dist/dependencies.js +11 -2
  36. package/dist/deploy/plan.d.ts +5 -0
  37. package/dist/deploy/plan.js +10 -0
  38. package/dist/destroy.d.ts +4 -4
  39. package/dist/destroy.js +24 -11
  40. package/dist/diagram.d.ts +32 -0
  41. package/dist/diagram.js +47 -0
  42. package/dist/doctor/checks.d.ts +2 -1
  43. package/dist/doctor/checks.js +26 -1
  44. package/dist/doctor/complexity.d.ts +13 -0
  45. package/dist/doctor/complexity.js +52 -0
  46. package/dist/doctor/crap.d.ts +14 -0
  47. package/dist/doctor/crap.js +67 -0
  48. package/dist/doctor/dependencies.d.ts +13 -0
  49. package/dist/doctor/dependencies.js +42 -0
  50. package/dist/doctor/duplication.d.ts +19 -0
  51. package/dist/doctor/duplication.js +106 -0
  52. package/dist/doctor/fan-out.d.ts +12 -0
  53. package/dist/doctor/fan-out.js +42 -0
  54. package/dist/doctor/feature-scatter.d.ts +15 -0
  55. package/dist/doctor/feature-scatter.js +84 -0
  56. package/dist/doctor/jsdoc.d.ts +44 -0
  57. package/dist/doctor/jsdoc.js +201 -0
  58. package/dist/doctor/module-size.d.ts +13 -0
  59. package/dist/doctor/module-size.js +50 -0
  60. package/dist/doctor/mutation.d.ts +20 -0
  61. package/dist/doctor/mutation.js +97 -0
  62. package/dist/doctor/orphans.d.ts +13 -0
  63. package/dist/doctor/orphans.js +50 -0
  64. package/dist/doctor/project.js +8 -5
  65. package/dist/doctor/result-throws.d.ts +17 -0
  66. package/dist/doctor/result-throws.js +72 -0
  67. package/dist/doctor/test-ratio.d.ts +12 -0
  68. package/dist/doctor/test-ratio.js +31 -0
  69. package/dist/fix/commands.d.ts +37 -0
  70. package/dist/fix/commands.js +63 -0
  71. package/dist/fix/emails.d.ts +21 -0
  72. package/dist/fix/emails.js +159 -0
  73. package/dist/fix/env.d.ts +29 -0
  74. package/dist/fix/env.js +58 -0
  75. package/dist/fix/index.d.ts +11 -0
  76. package/dist/fix/index.js +11 -0
  77. package/dist/fix/models.d.ts +20 -0
  78. package/dist/fix/models.js +95 -0
  79. package/dist/lock.js +12 -2
  80. package/dist/make/binding.d.ts +42 -0
  81. package/dist/make/binding.js +237 -0
  82. package/dist/make/generate.d.ts +11 -2
  83. package/dist/make/generate.js +47 -16
  84. package/dist/make/imports.js +7 -5
  85. package/dist/make/index.d.ts +4 -2
  86. package/dist/make/index.js +4 -1
  87. package/dist/make/kinds.d.ts +5 -0
  88. package/dist/make/kinds.js +14 -2
  89. package/dist/make/schema-diff.js +8 -1
  90. package/dist/make/stubs.d.ts +7 -2
  91. package/dist/make/stubs.js +8 -3
  92. package/dist/make/test.js +1 -0
  93. package/dist/models.js +7 -7
  94. package/dist/routes/modules.js +8 -5
  95. package/dist/routes/parse.js +8 -7
  96. package/dist/routes/routers.js +9 -5
  97. package/dist/scaffold/index.d.ts +2 -0
  98. package/dist/scaffold/index.js +13 -4
  99. package/dist/scaffold/render.d.ts +11 -1
  100. package/dist/scaffold/render.js +86 -1
  101. package/dist/setup/auth.d.ts +12 -0
  102. package/dist/setup/auth.js +209 -0
  103. package/dist/setup/billing.d.ts +11 -0
  104. package/dist/setup/billing.js +116 -0
  105. package/dist/setup/catalog.d.ts +25 -0
  106. package/dist/setup/catalog.js +34 -0
  107. package/dist/setup/credit.d.ts +13 -0
  108. package/dist/setup/credit.js +21 -0
  109. package/dist/setup/flags.d.ts +11 -0
  110. package/dist/setup/flags.js +62 -0
  111. package/dist/setup/index.d.ts +25 -0
  112. package/dist/setup/index.js +53 -0
  113. package/dist/setup/plan.d.ts +38 -0
  114. package/dist/setup/plan.js +62 -0
  115. package/dist/testing.js +3 -3
  116. package/dist/ui/layout.js +1 -1
  117. package/dist/ui/registry.d.ts +2 -2
  118. package/dist/upgrade/project.d.ts +2 -2
  119. package/dist/upgrade/prompt.js +7 -5
  120. package/package.json +10 -7
  121. package/registry/ui/attachment.json +2 -2
  122. package/registry/ui/sidebar.json +3 -3
  123. package/registry/ui/typeset.json +3 -3
  124. package/stubs/command.spec.stub +15 -0
  125. package/stubs/controller.api.spec.stub +15 -0
  126. package/stubs/controller.spec.stub +15 -0
  127. package/stubs/mcp.spec.stub +16 -0
  128. package/stubs/scaffold.migration.stub +2 -1
  129. package/stubs/scaffold.spec.stub +7 -0
  130. package/templates/app/AGENTS.md +21 -4
  131. package/templates/app/README.md +6 -3
  132. package/templates/app/app/commands/typegen.test.ts +20 -1
  133. package/templates/app/app/commands/typegen.ts +16 -2
  134. package/templates/app/app/initializers/cli.ts +7 -0
  135. package/templates/app/app/initializers/mail-transport.test.ts +8 -2
  136. package/templates/app/app/test/cloudflare-workers.ts +2 -0
  137. package/templates/app/package.json +1 -0
  138. package/templates/app/spec/config.jsonc +16 -0
package/README.md CHANGED
@@ -14,15 +14,15 @@ 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
19
  sdxc make middleware require-user --mount page # called last in the page chain
20
20
  sdxc make model post title author_id # the model, its migration and its factory
21
21
  sdxc make migration add-slug-to-posts 'slug?' # ALTER TABLE, read from the name
22
22
  sdxc make migration add-slug --from-model post # the SQL app/models/post.ts needs
23
23
  sdxc scaffold post title body published_at # types follow the names: text, timestamp
24
- sdxc scaffold post title body --api # JSON endpoints and their OpenAPI operations
25
- sdxc destroy controller posts/show # remove it, its mapping and its declaration
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
26
  sdxc models post # the table app/models/post.ts declares, vs the migrations
27
27
  sdxc ui add dialog # copy a component into the project to edit it
28
28
  sdxc ui update --all # move every unedited copy to the installed @sdxc/ui
@@ -30,7 +30,7 @@ sdxc upgrade # move to the latest release and print a pr
30
30
  sdxc doctor # report release drift, missing secrets and app-layout slips
31
31
  sdxc routes --json # every route, its controller and middleware, for an agent
32
32
  sdxc routes -g posts --method post # narrow it, as rails routes does; --unused, -c, -E too
33
- sdxc run users find ada@example.com # run the app's own command line, bootstrap/cli.ts
33
+ sdxc run users find ada@example.com # run the project's command line (run.entry)
34
34
  sdxc deploy # build, then the app's db migrate --remote and deploy
35
35
  ```
36
36
 
@@ -45,31 +45,31 @@ Every `@sdxc/*` package versions as the UTC date it was published, and a daily r
45
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
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
47
 
48
- `sdxc doctor` also checks secrets, migrations and the app layout, 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.
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.
49
49
 
50
50
  ## API
51
51
 
52
52
  ### Commands
53
53
 
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 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 |
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 project's command line (`run.entry`, default `bootstrap/cli.ts`) |
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
73
 
74
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
75
 
@@ -94,7 +94,7 @@ Build, then run the app's db migrate --remote and deploy commands
94
94
 
95
95
  #### `sdxc destroy <kind> <name>`
96
96
 
97
- Remove a file sdxc make wrote, its test, its mapping and its declaration
97
+ Remove a file sdxc make wrote, its test, its pairing .spec, its mapping and its declaration
98
98
 
99
99
  | Flag | Does |
100
100
  | ------------ | ----------------------------------------------------------- |
@@ -104,7 +104,7 @@ Remove a file sdxc make wrote, its test, its mapping and its declaration
104
104
 
105
105
  #### `sdxc doctor`
106
106
 
107
- Lint release drift, secrets, migrations, app layout and project checks
107
+ Lint release drift, secrets, migrations, app layout, complexity and project checks
108
108
 
109
109
  | Flag | Does |
110
110
  | ---------------- | ------------------------------------- |
@@ -112,6 +112,38 @@ Lint release drift, secrets, migrations, app layout and project checks
112
112
  | `--only <check>` | Run only the named checks |
113
113
  | `--skip <check>` | Leave out the named checks |
114
114
 
115
+ #### `sdxc fix`
116
+
117
+ Apply doctor repairs the kit can make safely
118
+
119
+ | Flag | Does |
120
+ | ----------- | ---------------------------------------------- |
121
+ | `--dry-run` | Print what would be written and change nothing |
122
+
123
+ #### `sdxc fix env`
124
+
125
+ Append missing bindings.secret() keys to .env.example
126
+
127
+ | Flag | Does |
128
+ | ----------- | ---------------------------------------------- |
129
+ | `--dry-run` | Print what would be written and change nothing |
130
+
131
+ #### `sdxc fix models`
132
+
133
+ Register unmapped createModel modules in app/models/index.ts
134
+
135
+ | Flag | Does |
136
+ | ----------- | ---------------------------------------------- |
137
+ | `--dry-run` | Print what would be written and change nothing |
138
+
139
+ #### `sdxc fix emails`
140
+
141
+ Map unmapped emails in app/initializers/mail.ts
142
+
143
+ | Flag | Does |
144
+ | ----------- | ---------------------------------------------- |
145
+ | `--dry-run` | Print what would be written and change nothing |
146
+
115
147
  #### `sdxc init`
116
148
 
117
149
  Write .config/sdxc.jsonc with every default spelled out
@@ -132,11 +164,11 @@ List the initializers in app/initializers, their exports and what builds them
132
164
 
133
165
  Write a controller, job, model or other file where the app layout puts it
134
166
 
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 and its test when they exist, keeping their declaration |
167
+ | Flag | Does |
168
+ | ----------- | ------------------------------------------------------------------------------------------- |
169
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
170
+ | `--dry-run` | Print what would be written and change nothing |
171
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
140
172
 
141
173
  #### `sdxc make controller <name>`
142
174
 
@@ -150,52 +182,53 @@ A route handler in app/http/controllers, declared and mapped
150
182
  | `--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
183
  | `--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
184
  | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
185
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
153
186
  | `--dry-run` | Print what would be written and change nothing |
154
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
187
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
155
188
 
156
189
  #### `sdxc make middleware <name>`
157
190
 
158
191
  A middleware in app/http/middleware
159
192
 
160
- | Flag | Does |
161
- | ------------------ | ----------------------------------------------------------------------------------------- |
162
- | `--mount <target>` | Also call it last in a chain: a router initializer (router) or a chain module (page, api) |
163
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
164
- | `--dry-run` | Print what would be written and change nothing |
165
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
193
+ | Flag | Does |
194
+ | ------------------ | ------------------------------------------------------------------------------------------- |
195
+ | `--mount <target>` | Also call it last in a chain: a router initializer (router) or a chain module (page, api) |
196
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
197
+ | `--dry-run` | Print what would be written and change nothing |
198
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
166
199
 
167
200
  #### `sdxc make validator <name>`
168
201
 
169
202
  An input validator in app/http/validators
170
203
 
171
- | Flag | Does |
172
- | ----------- | ----------------------------------------------------------------------------- |
173
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
174
- | `--dry-run` | Print what would be written and change nothing |
175
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
204
+ | Flag | Does |
205
+ | ----------- | ------------------------------------------------------------------------------------------- |
206
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
207
+ | `--dry-run` | Print what would be written and change nothing |
208
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
176
209
 
177
210
  #### `sdxc make job <name>`
178
211
 
179
212
  A background job in app/jobs, declared and mapped
180
213
 
181
- | Flag | Does |
182
- | --------------------- | -------------------------------------------------------------------------------- |
183
- | `--cron <expression>` | A scheduled job instead of one with input, with the Worker trigger that fires it |
184
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
185
- | `--dry-run` | Print what would be written and change nothing |
186
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
214
+ | Flag | Does |
215
+ | --------------------- | ------------------------------------------------------------------------------------------- |
216
+ | `--cron <expression>` | A scheduled job instead of one with input, with the Worker trigger that fires it |
217
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
218
+ | `--dry-run` | Print what would be written and change nothing |
219
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
187
220
 
188
221
  #### `sdxc make model <name> [field[:type][?]...]`
189
222
 
190
223
  A model in app/models, with the migration creating its table and its factory
191
224
 
192
- | Flag | Does |
193
- | ----------------- | ----------------------------------------------------------------------------- |
194
- | `--chain <chain>` | The chain in make.migrations the migration goes in (default: default) |
195
- | `--skip <file>` | Leave out the migration or the factory; repeat it or list them |
196
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
197
- | `--dry-run` | Print what would be written and change nothing |
198
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
225
+ | Flag | Does |
226
+ | ----------------- | ------------------------------------------------------------------------------------------- |
227
+ | `--chain <chain>` | The chain in make.migrations the migration goes in (default: default) |
228
+ | `--skip <file>` | Leave out the migration or the factory; repeat it or list them |
229
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
230
+ | `--dry-run` | Print what would be written and change nothing |
231
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
199
232
 
200
233
  #### `sdxc make migration <name> [field[:type][?]...]`
201
234
 
@@ -211,71 +244,73 @@ A numbered SQL migration in a configured chain
211
244
 
212
245
  A test factory in database/factories
213
246
 
214
- | Flag | Does |
215
- | ----------- | ------------------------------------------------------------------------ |
216
- | `--dry-run` | Print what would be written and change nothing |
217
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
247
+ | Flag | Does |
248
+ | ----------- | ------------------------------------------------------------------------------------------- |
249
+ | `--dry-run` | Print what would be written and change nothing |
250
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
218
251
 
219
252
  #### `sdxc make service <name>`
220
253
 
221
254
  A service in app/services
222
255
 
223
- | Flag | Does |
224
- | ----------- | ----------------------------------------------------------------------------- |
225
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
226
- | `--dry-run` | Print what would be written and change nothing |
227
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
256
+ | Flag | Does |
257
+ | ----------- | ------------------------------------------------------------------------------------------- |
258
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
259
+ | `--dry-run` | Print what would be written and change nothing |
260
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
228
261
 
229
262
  #### `sdxc make policy <name>`
230
263
 
231
264
  A resource's create, read, update and delete abilities in app/policies, with their test
232
265
 
233
- | Flag | Does |
234
- | ----------- | ----------------------------------------------------------------------------- |
235
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
236
- | `--dry-run` | Print what would be written and change nothing |
237
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
266
+ | Flag | Does |
267
+ | ----------- | ------------------------------------------------------------------------------------------- |
268
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
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 |
238
271
 
239
272
  #### `sdxc make initializer <name>`
240
273
 
241
274
  An initializer in app/initializers
242
275
 
243
- | Flag | Does |
244
- | ----------- | ----------------------------------------------------------------------------- |
245
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
246
- | `--dry-run` | Print what would be written and change nothing |
247
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
276
+ | Flag | Does |
277
+ | ----------- | ------------------------------------------------------------------------------------------- |
278
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
279
+ | `--dry-run` | Print what would be written and change nothing |
280
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
248
281
 
249
282
  #### `sdxc make email <name> [field[:type][?]...]`
250
283
 
251
284
  An email template in app/emails, its props declared and the template mapped
252
285
 
253
- | Flag | Does |
254
- | ----------- | ----------------------------------------------------------------------------- |
255
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
256
- | `--dry-run` | Print what would be written and change nothing |
257
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
286
+ | Flag | Does |
287
+ | ----------- | ------------------------------------------------------------------------------------------- |
288
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
289
+ | `--dry-run` | Print what would be written and change nothing |
290
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
258
291
 
259
292
  #### `sdxc make mcp <name>`
260
293
 
261
294
  An MCP tool in app/mcp/tools, or a resource, declared and mapped
262
295
 
263
- | Flag | Does |
264
- | ------------ | ----------------------------------------------------------------------------- |
265
- | `--resource` | A resource in app/mcp/resources instead of a tool |
266
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
267
- | `--dry-run` | Print what would be written and change nothing |
268
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
296
+ | Flag | Does |
297
+ | ------------ | ------------------------------------------------------------------------------------------- |
298
+ | `--resource` | A resource in app/mcp/resources instead of a tool |
299
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
300
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
301
+ | `--dry-run` | Print what would be written and change nothing |
302
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
269
303
 
270
304
  #### `sdxc make command <name>`
271
305
 
272
306
  A command-line command in app/commands, declared and mapped
273
307
 
274
- | Flag | Does |
275
- | ----------- | ----------------------------------------------------------------------------- |
276
- | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
277
- | `--dry-run` | Print what would be written and change nothing |
278
- | `--force` | Replace the file and its test when they exist, keeping their declaration |
308
+ | Flag | Does |
309
+ | ----------- | ------------------------------------------------------------------------------------------- |
310
+ | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
311
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
312
+ | `--dry-run` | Print what would be written and change nothing |
313
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
279
314
 
280
315
  #### `sdxc make test <file>`
281
316
 
@@ -290,6 +325,35 @@ The test make writes beside a file, for an existing file without one
290
325
 
291
326
  Copy the built-in stubs into make.stubs to edit
292
327
 
328
+ #### `sdxc make secret <NAME>`
329
+
330
+ Declare a bindings.secret() in cloudflare.config.ts and append .env.example
331
+
332
+ | Flag | Does |
333
+ | ----------- | ------------------------------------------------------------------------------------------- |
334
+ | `--dry-run` | Print what would be written and change nothing |
335
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
336
+
337
+ #### `sdxc make binding <kind> <NAME>`
338
+
339
+ Declare a Cloudflare binding in cloudflare.config.ts
340
+
341
+ | Flag | Does |
342
+ | ----------- | ------------------------------------------------------------------------------------------- |
343
+ | `--dry-run` | Print what would be written and change nothing |
344
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
345
+
346
+ #### `sdxc make do <name>`
347
+
348
+ Write a Durable Object class, re-export it from bootstrap/worker.ts, and declare its binding
349
+
350
+ | Flag | Does |
351
+ | ------------------ | ------------------------------------------------------------------------------------------- |
352
+ | `--role <role>` | app/models when it owns stored state, app/services otherwise (default: service) |
353
+ | `--binding <NAME>` | The env binding key (default: derived from the class name) |
354
+ | `--dry-run` | Print what would be written and change nothing |
355
+ | `--force` | Replace the file, its test and its pairing .spec when they exist, keeping their declaration |
356
+
293
357
  #### `sdxc middleware`
294
358
 
295
359
  Print each router's global middleware and every chain in app/http/middleware
@@ -333,7 +397,7 @@ Print every route with its controller and the middleware that runs for it
333
397
 
334
398
  #### `sdxc run [command...]`
335
399
 
336
- Run the project's own command line, bootstrap/cli.ts, with its runtime
400
+ Run the project's own command line (run.entry, default bootstrap/cli.ts)
337
401
 
338
402
  #### `sdxc scaffold <name> [field[:type][?]...]`
339
403
 
@@ -347,6 +411,7 @@ Write a resource's model, migration, pages, tests and more, declared and mapped
347
411
  | `--api` | JSON endpoints in routes/api.ts with their OpenAPI operations, instead of pages |
348
412
  | `--skip <piece>` | Leave out pieces the project already has: model, migration, factory, validator, policy, pages; repeat it or list them |
349
413
  | `--test` | Write a test beside the file, or skip it with --no-test (default: make.tests) |
414
+ | `--spec` | Write a pairing .spec under spec/, or skip it with --no-spec (default: make.specs) |
350
415
  | `--dry-run` | Print what would be written and change nothing |
351
416
 
352
417
  #### `sdxc schedule`
@@ -357,6 +422,16 @@ List the scheduled jobs, their next runs and the Worker triggers that fire them
357
422
  | -------- | -------------------------- |
358
423
  | `--json` | Print the schedule as JSON |
359
424
 
425
+ #### `sdxc setup [feature]`
426
+
427
+ Install a multi-file feature (auth, billing, flags); lists known features with no name
428
+
429
+ | Flag | Does |
430
+ | ----------------------- | ------------------------------------------------------------------ |
431
+ | `--provider <provider>` | Backend for features that vary (auth: r3-auth; billing: polar) |
432
+ | `-y, --yes` | Write the plan; without it the plan is printed and nothing changes |
433
+ | `--dry-run` | Print what would be written and change nothing |
434
+
360
435
  #### `sdxc stats`
361
436
 
362
437
  Count lines of code per kind of code the app layout names, and the test ratio
@@ -365,6 +440,15 @@ Count lines of code per kind of code the app layout names, and the test ratio
365
440
  | -------- | ------------------------ |
366
441
  | `--json` | Print the counts as JSON |
367
442
 
443
+ #### `sdxc diagram`
444
+
445
+ Draw the project's layer architecture as Mermaid, or as SVG through @sdxc/diagram
446
+
447
+ | Flag | Does |
448
+ | -------------- | ---------------------------------------------------------------------------------- |
449
+ | `--json` | Print the import graph as JSON instead of Mermaid |
450
+ | `--svg <path>` | Write an SVG drawing to this path (relative to the project root) via @sdxc/diagram |
451
+
368
452
  #### `sdxc ui list`
369
453
 
370
454
  Every component, marking copies that are edited or behind
@@ -426,6 +510,7 @@ The CLI reads `.config/sdxc.jsonc` (or `sdxc.jsonc` at the project root). Every
426
510
  | `make.routes` | `web` | Route contract `sdxc make controller` adds to, a module in `routes/` |
427
511
  | `make.migrations` | `{ "default": "database/migrations" }` | Migration chains by name |
428
512
  | `make.tests` | `true` | Write a test beside every generated file except migrations and factories |
513
+ | `make.specs` | `true` | Write a pairing `.spec` for controllers, commands, MCP tools and scaffolds |
429
514
  | `make.stubs` | `.config/sdxc/stubs` | Stubs that replace the built-in ones |
430
515
  | `doctor.checks` | `.config/sdxc/checks` | The project's own `sdxc doctor` checks, one module each |
431
516
  | `doctor.migrations.accept` | `[]` | Migration errors `sdxc doctor` steps past, each `{ "file", "column" }` |