primitive-admin 1.0.61 → 1.0.62

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 (300) hide show
  1. package/README.md +125 -69
  2. package/assets/skill/skills/primitive-platform/SKILL.md +336 -37
  3. package/dist/bin/primitive.js +25 -14
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/analytics.js +36 -16
  6. package/dist/src/commands/analytics.js.map +1 -1
  7. package/dist/src/commands/apps.js +49 -188
  8. package/dist/src/commands/apps.js.map +1 -1
  9. package/dist/src/commands/blob-buckets.js +13 -153
  10. package/dist/src/commands/blob-buckets.js.map +1 -1
  11. package/dist/src/commands/collection-type-configs.js +14 -100
  12. package/dist/src/commands/collection-type-configs.js.map +1 -1
  13. package/dist/src/commands/collections.js +47 -8
  14. package/dist/src/commands/collections.js.map +1 -1
  15. package/dist/src/commands/config.d.ts +46 -0
  16. package/dist/src/commands/config.js +479 -0
  17. package/dist/src/commands/config.js.map +1 -0
  18. package/dist/src/commands/connections.js +12 -7
  19. package/dist/src/commands/connections.js.map +1 -1
  20. package/dist/src/commands/cron-triggers.js +84 -176
  21. package/dist/src/commands/cron-triggers.js.map +1 -1
  22. package/dist/src/commands/database-type-configs.d.ts +2 -0
  23. package/dist/src/commands/database-type-configs.js +171 -0
  24. package/dist/src/commands/database-type-configs.js.map +1 -0
  25. package/dist/src/commands/database-types.js +4 -4
  26. package/dist/src/commands/database-types.js.map +1 -1
  27. package/dist/src/commands/databases.d.ts +63 -0
  28. package/dist/src/commands/databases.js +649 -87
  29. package/dist/src/commands/databases.js.map +1 -1
  30. package/dist/src/commands/documents.js +869 -12
  31. package/dist/src/commands/documents.js.map +1 -1
  32. package/dist/src/commands/email-templates.js +18 -125
  33. package/dist/src/commands/email-templates.js.map +1 -1
  34. package/dist/src/commands/env.d.ts +12 -1
  35. package/dist/src/commands/env.js +98 -25
  36. package/dist/src/commands/env.js.map +1 -1
  37. package/dist/src/commands/feature-flags.d.ts +14 -0
  38. package/dist/src/commands/feature-flags.js +116 -0
  39. package/dist/src/commands/feature-flags.js.map +1 -0
  40. package/dist/src/commands/group-type-configs.js +14 -109
  41. package/dist/src/commands/group-type-configs.js.map +1 -1
  42. package/dist/src/commands/init.d.ts +9 -1
  43. package/dist/src/commands/init.js +1056 -277
  44. package/dist/src/commands/init.js.map +1 -1
  45. package/dist/src/commands/integrations.js +136 -421
  46. package/dist/src/commands/integrations.js.map +1 -1
  47. package/dist/src/commands/metadata-category-configs.d.ts +12 -0
  48. package/dist/src/commands/metadata-category-configs.js +112 -0
  49. package/dist/src/commands/metadata-category-configs.js.map +1 -0
  50. package/dist/src/commands/metadata.js +33 -141
  51. package/dist/src/commands/metadata.js.map +1 -1
  52. package/dist/src/commands/prompts.js +206 -563
  53. package/dist/src/commands/prompts.js.map +1 -1
  54. package/dist/src/commands/rule-sets.d.ts +1 -1
  55. package/dist/src/commands/rule-sets.js +16 -132
  56. package/dist/src/commands/rule-sets.js.map +1 -1
  57. package/dist/src/commands/scripts.js +67 -234
  58. package/dist/src/commands/scripts.js.map +1 -1
  59. package/dist/src/commands/sessions.js +17 -5
  60. package/dist/src/commands/sessions.js.map +1 -1
  61. package/dist/src/commands/sync-app-settings.d.ts +113 -70
  62. package/dist/src/commands/sync-app-settings.js +193 -242
  63. package/dist/src/commands/sync-app-settings.js.map +1 -1
  64. package/dist/src/commands/sync.d.ts +1932 -49
  65. package/dist/src/commands/sync.js +9521 -1769
  66. package/dist/src/commands/sync.js.map +1 -1
  67. package/dist/src/commands/tokens.js +8 -2
  68. package/dist/src/commands/tokens.js.map +1 -1
  69. package/dist/src/commands/users.js +92 -1
  70. package/dist/src/commands/users.js.map +1 -1
  71. package/dist/src/commands/vars.js +44 -58
  72. package/dist/src/commands/vars.js.map +1 -1
  73. package/dist/src/commands/webhooks.js +318 -156
  74. package/dist/src/commands/webhooks.js.map +1 -1
  75. package/dist/src/commands/workflows.d.ts +49 -12
  76. package/dist/src/commands/workflows.js +652 -1086
  77. package/dist/src/commands/workflows.js.map +1 -1
  78. package/dist/src/lib/access-rule-display.d.ts +21 -0
  79. package/dist/src/lib/access-rule-display.js +34 -0
  80. package/dist/src/lib/access-rule-display.js.map +1 -0
  81. package/dist/src/lib/api-client.d.ts +541 -61
  82. package/dist/src/lib/api-client.js +559 -102
  83. package/dist/src/lib/api-client.js.map +1 -1
  84. package/dist/src/lib/app-settings-descriptor.d.ts +180 -25
  85. package/dist/src/lib/app-settings-descriptor.js +403 -82
  86. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  87. package/dist/src/lib/canonical-json.d.ts +12 -0
  88. package/dist/src/lib/canonical-json.js +35 -0
  89. package/dist/src/lib/canonical-json.js.map +1 -0
  90. package/dist/src/lib/cli-manifest.d.ts +8 -0
  91. package/dist/src/lib/cli-manifest.js +1 -0
  92. package/dist/src/lib/cli-manifest.js.map +1 -1
  93. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +6 -2
  94. package/dist/src/lib/codegen-shared/generatedFiles.js +9 -2
  95. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  96. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +6 -6
  97. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +8 -8
  98. package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
  99. package/dist/src/lib/config-object-descriptor.d.ts +127 -0
  100. package/dist/src/lib/config-object-descriptor.js +658 -0
  101. package/dist/src/lib/config-object-descriptor.js.map +1 -0
  102. package/dist/src/lib/config-payload.d.ts +85 -0
  103. package/dist/src/lib/config-payload.js +116 -0
  104. package/dist/src/lib/config-payload.js.map +1 -0
  105. package/dist/src/lib/config-surface.d.ts +130 -0
  106. package/dist/src/lib/config-surface.js +300 -0
  107. package/dist/src/lib/config-surface.js.map +1 -0
  108. package/dist/src/lib/credentials-store.d.ts +10 -0
  109. package/dist/src/lib/credentials-store.js +23 -0
  110. package/dist/src/lib/credentials-store.js.map +1 -1
  111. package/dist/src/lib/data-input.d.ts +23 -0
  112. package/dist/src/lib/data-input.js +50 -0
  113. package/dist/src/lib/data-input.js.map +1 -0
  114. package/dist/src/lib/db-codegen/dbTemplates.js +1 -1
  115. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  116. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +1 -1
  117. package/dist/src/lib/env-resolver-core.d.ts +147 -0
  118. package/dist/src/lib/env-resolver-core.js +265 -0
  119. package/dist/src/lib/env-resolver-core.js.map +1 -0
  120. package/dist/src/lib/env-resolver.d.ts +28 -6
  121. package/dist/src/lib/env-resolver.js +44 -32
  122. package/dist/src/lib/env-resolver.js.map +1 -1
  123. package/dist/src/lib/generated-allowlist.js +12 -0
  124. package/dist/src/lib/generated-allowlist.js.map +1 -1
  125. package/dist/src/lib/generated-config-surfaces.d.ts +682 -0
  126. package/dist/src/lib/generated-config-surfaces.js +4058 -0
  127. package/dist/src/lib/generated-config-surfaces.js.map +1 -0
  128. package/dist/src/lib/generated-template-lint.d.ts +212 -0
  129. package/dist/src/lib/generated-template-lint.js +624 -0
  130. package/dist/src/lib/generated-template-lint.js.map +1 -0
  131. package/dist/src/lib/init-adopt.d.ts +16 -0
  132. package/dist/src/lib/init-adopt.js +34 -0
  133. package/dist/src/lib/init-adopt.js.map +1 -0
  134. package/dist/src/lib/init-assets.d.ts +39 -0
  135. package/dist/src/lib/init-assets.js +97 -0
  136. package/dist/src/lib/init-assets.js.map +1 -0
  137. package/dist/src/lib/init-config.d.ts +44 -5
  138. package/dist/src/lib/init-config.js +80 -7
  139. package/dist/src/lib/init-config.js.map +1 -1
  140. package/dist/src/lib/init-ios-links.d.ts +50 -0
  141. package/dist/src/lib/init-ios-links.js +153 -0
  142. package/dist/src/lib/init-ios-links.js.map +1 -0
  143. package/dist/src/lib/init-plan.d.ts +80 -0
  144. package/dist/src/lib/init-plan.js +95 -0
  145. package/dist/src/lib/init-plan.js.map +1 -0
  146. package/dist/src/lib/init-production-env.d.ts +48 -0
  147. package/dist/src/lib/init-production-env.js +59 -0
  148. package/dist/src/lib/init-production-env.js.map +1 -0
  149. package/dist/src/lib/init-schema.d.ts +74 -0
  150. package/dist/src/lib/init-schema.js +358 -0
  151. package/dist/src/lib/init-schema.js.map +1 -0
  152. package/dist/src/lib/init-xcode.d.ts +33 -0
  153. package/dist/src/lib/init-xcode.js +114 -0
  154. package/dist/src/lib/init-xcode.js.map +1 -0
  155. package/dist/src/lib/integration-request-config.d.ts +30 -0
  156. package/dist/src/lib/integration-request-config.js +145 -0
  157. package/dist/src/lib/integration-request-config.js.map +1 -0
  158. package/dist/src/lib/local-state.d.ts +55 -0
  159. package/dist/src/lib/local-state.js +167 -0
  160. package/dist/src/lib/local-state.js.map +1 -0
  161. package/dist/src/lib/log-inspection.d.ts +568 -0
  162. package/dist/src/lib/log-inspection.js +639 -0
  163. package/dist/src/lib/log-inspection.js.map +1 -0
  164. package/dist/src/lib/migration-nag.d.ts +2 -2
  165. package/dist/src/lib/migration-nag.js +3 -3
  166. package/dist/src/lib/object-status-filter.d.ts +22 -0
  167. package/dist/src/lib/object-status-filter.js +45 -0
  168. package/dist/src/lib/object-status-filter.js.map +1 -0
  169. package/dist/src/lib/output.d.ts +24 -1
  170. package/dist/src/lib/output.js +42 -1
  171. package/dist/src/lib/output.js.map +1 -1
  172. package/dist/src/lib/package-manager.d.ts +140 -0
  173. package/dist/src/lib/package-manager.js +305 -0
  174. package/dist/src/lib/package-manager.js.map +1 -0
  175. package/dist/src/lib/paginate.d.ts +50 -0
  176. package/dist/src/lib/paginate.js +53 -0
  177. package/dist/src/lib/paginate.js.map +1 -1
  178. package/dist/src/lib/platform-owned.d.ts +29 -3
  179. package/dist/src/lib/platform-owned.js +42 -3
  180. package/dist/src/lib/platform-owned.js.map +1 -1
  181. package/dist/src/lib/project-config.js +13 -5
  182. package/dist/src/lib/project-config.js.map +1 -1
  183. package/dist/src/lib/query-operators.d.ts +1 -1
  184. package/dist/src/lib/query-operators.js +1 -1
  185. package/dist/src/lib/record-filter.d.ts +18 -0
  186. package/dist/src/lib/record-filter.js +55 -0
  187. package/dist/src/lib/record-filter.js.map +1 -0
  188. package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
  189. package/dist/src/lib/resolve-init-dev-port.js +55 -0
  190. package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
  191. package/dist/src/lib/resolve-init-server.d.ts +64 -0
  192. package/dist/src/lib/resolve-init-server.js +77 -0
  193. package/dist/src/lib/resolve-init-server.js.map +1 -0
  194. package/dist/src/lib/resolve-platform.d.ts +43 -14
  195. package/dist/src/lib/resolve-platform.js +74 -12
  196. package/dist/src/lib/resolve-platform.js.map +1 -1
  197. package/dist/src/lib/run-status.d.ts +19 -0
  198. package/dist/src/lib/run-status.generated.d.ts +39 -0
  199. package/dist/src/lib/run-status.generated.js +66 -0
  200. package/dist/src/lib/run-status.generated.js.map +1 -0
  201. package/dist/src/lib/run-status.js +19 -0
  202. package/dist/src/lib/run-status.js.map +1 -0
  203. package/dist/src/lib/server-text-normalization.d.ts +51 -0
  204. package/dist/src/lib/server-text-normalization.js +90 -0
  205. package/dist/src/lib/server-text-normalization.js.map +1 -0
  206. package/dist/src/lib/server-url.d.ts +22 -0
  207. package/dist/src/lib/server-url.js +33 -0
  208. package/dist/src/lib/server-url.js.map +1 -0
  209. package/dist/src/lib/signing-secret-status.d.ts +81 -0
  210. package/dist/src/lib/signing-secret-status.js +116 -0
  211. package/dist/src/lib/signing-secret-status.js.map +1 -0
  212. package/dist/src/lib/skill-installer.js +6 -3
  213. package/dist/src/lib/skill-installer.js.map +1 -1
  214. package/dist/src/lib/snapshots.d.ts +2 -2
  215. package/dist/src/lib/snapshots.js +2 -2
  216. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +15 -2
  217. package/dist/src/lib/swift-codegen/dbGenerator.js +250 -18
  218. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
  219. package/dist/src/lib/swift-codegen/generator.d.ts +11 -2
  220. package/dist/src/lib/swift-codegen/generator.js +181 -7
  221. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  222. package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +7 -3
  223. package/dist/src/lib/swift-codegen/siblingSymbols.js +4 -1
  224. package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -1
  225. package/dist/src/lib/sync-dir-selector.d.ts +21 -0
  226. package/dist/src/lib/sync-dir-selector.js +30 -0
  227. package/dist/src/lib/sync-dir-selector.js.map +1 -0
  228. package/dist/src/lib/sync-paths.d.ts +39 -0
  229. package/dist/src/lib/sync-paths.js +70 -2
  230. package/dist/src/lib/sync-paths.js.map +1 -1
  231. package/dist/src/lib/sync-resource-types.d.ts +138 -31
  232. package/dist/src/lib/sync-resource-types.js +241 -47
  233. package/dist/src/lib/sync-resource-types.js.map +1 -1
  234. package/dist/src/lib/sync-selectors.d.ts +95 -0
  235. package/dist/src/lib/sync-selectors.js +228 -0
  236. package/dist/src/lib/sync-selectors.js.map +1 -0
  237. package/dist/src/lib/template.d.ts +62 -4
  238. package/dist/src/lib/template.js +147 -39
  239. package/dist/src/lib/template.js.map +1 -1
  240. package/dist/src/lib/test-case-keys.d.ts +29 -0
  241. package/dist/src/lib/test-case-keys.js +55 -0
  242. package/dist/src/lib/test-case-keys.js.map +1 -0
  243. package/dist/src/lib/test-case-variables.d.ts +15 -0
  244. package/dist/src/lib/test-case-variables.js +29 -0
  245. package/dist/src/lib/test-case-variables.js.map +1 -0
  246. package/dist/src/lib/toml-database-config.d.ts +4 -4
  247. package/dist/src/lib/toml-database-config.js +27 -34
  248. package/dist/src/lib/toml-database-config.js.map +1 -1
  249. package/dist/src/lib/toml-metadata-config.d.ts +9 -5
  250. package/dist/src/lib/toml-metadata-config.js +40 -45
  251. package/dist/src/lib/toml-metadata-config.js.map +1 -1
  252. package/dist/src/lib/toml-native-form.d.ts +1 -1
  253. package/dist/src/lib/toml-native-form.js +1 -1
  254. package/dist/src/lib/toml-params-validator.d.ts +1 -1
  255. package/dist/src/lib/toml-params-validator.js +1 -1
  256. package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
  257. package/dist/src/lib/toml-scalar-edit.js +283 -0
  258. package/dist/src/lib/toml-scalar-edit.js.map +1 -0
  259. package/dist/src/lib/user-selector.d.ts +24 -0
  260. package/dist/src/lib/user-selector.js +33 -0
  261. package/dist/src/lib/user-selector.js.map +1 -0
  262. package/dist/src/lib/version-check.d.ts +25 -0
  263. package/dist/src/lib/version-check.js +77 -8
  264. package/dist/src/lib/version-check.js.map +1 -1
  265. package/dist/src/lib/watch.d.ts +121 -0
  266. package/dist/src/lib/watch.js +169 -0
  267. package/dist/src/lib/watch.js.map +1 -0
  268. package/dist/src/lib/workflow-apply.d.ts +69 -45
  269. package/dist/src/lib/workflow-apply.js +99 -72
  270. package/dist/src/lib/workflow-apply.js.map +1 -1
  271. package/dist/src/lib/workflow-codegen/generator.js +4 -4
  272. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  273. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +11 -0
  274. package/dist/src/lib/workflow-codegen/invokerIR.js +5 -0
  275. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
  276. package/dist/src/lib/workflow-config-apply.d.ts +70 -0
  277. package/dist/src/lib/workflow-config-apply.js +137 -0
  278. package/dist/src/lib/workflow-config-apply.js.map +1 -0
  279. package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
  280. package/dist/src/lib/workflow-config-sidecar.js +96 -0
  281. package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
  282. package/dist/src/lib/workflow-defaults.d.ts +29 -0
  283. package/dist/src/lib/workflow-defaults.js +41 -0
  284. package/dist/src/lib/workflow-defaults.js.map +1 -0
  285. package/dist/src/lib/workflow-include-preserve.d.ts +76 -0
  286. package/dist/src/lib/workflow-include-preserve.js +286 -0
  287. package/dist/src/lib/workflow-include-preserve.js.map +1 -0
  288. package/dist/src/lib/workflow-payload.d.ts +31 -20
  289. package/dist/src/lib/workflow-payload.js +100 -110
  290. package/dist/src/lib/workflow-payload.js.map +1 -1
  291. package/dist/src/lib/workflow-toml-validator.d.ts +37 -16
  292. package/dist/src/lib/workflow-toml-validator.js +141 -16
  293. package/dist/src/lib/workflow-toml-validator.js.map +1 -1
  294. package/dist/src/types/index.d.ts +78 -22
  295. package/dist/src/validators.d.ts +7 -7
  296. package/dist/src/validators.js +6 -6
  297. package/package.json +11 -6
  298. package/dist/src/commands/settings.d.ts +0 -15
  299. package/dist/src/commands/settings.js +0 -102
  300. package/dist/src/commands/settings.js.map +0 -1
package/README.md CHANGED
@@ -5,9 +5,13 @@ Command-line interface for administering Primitive applications. This CLI provid
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install -g primitive-admin
8
+ pnpm add -g primitive-admin
9
9
  ```
10
10
 
11
+ pnpm is the recommended package manager. If you use npm instead, run
12
+ `npm install -g primitive-admin` — install with one manager only, or you end up
13
+ with two global copies.
14
+
11
15
  ### Development Setup
12
16
 
13
17
  From the **worklet root directory**:
@@ -133,17 +137,20 @@ Manage applications (requires admin access).
133
137
 
134
138
  ```bash
135
139
  primitive apps list # List all accessible apps
136
- primitive apps create "My App" # Create a new app
140
+ primitive apps create "My App" # Create a new app (mints the app id)
137
141
  primitive apps get <app-id> # Get app details
138
- primitive apps update <app-id> [opts] # Update app settings
139
142
  primitive apps delete <app-id> # Delete an app
140
143
  ```
141
144
 
142
- **Update options:**
143
- - `--name <name>` - App display name
144
- - `--mode <mode>` - Access mode: public, invite-only, waitlist
145
- - `--base-url <url>` - Application base URL
146
- - `--waitlist` / `--no-waitlist` - Enable/disable waitlist
145
+ App settings are configuration, so they are authored in `app.toml` and applied
146
+ with `config push` (issue #2645) there is no `apps update`:
147
+
148
+ ```bash
149
+ primitive apps get # what the server is running
150
+ primitive config pull --only app # write those settings into app.toml
151
+ primitive config set app app.mode=invite-only
152
+ primitive config push --only app # apply the edit
153
+ ```
147
154
  - `--google-oauth` / `--no-google-oauth` - Enable/disable Google OAuth
148
155
  - `--passkey` / `--no-passkey` - Enable/disable passkey auth
149
156
  - `--magic-link` / `--no-magic-link` - Enable/disable magic link auth
@@ -180,34 +187,27 @@ Manage HTTP integrations (external API connections).
180
187
 
181
188
  ```bash
182
189
  primitive integrations list [app-id] # List integrations
183
- primitive integrations create [app-id] [options] # Create integration
184
190
  primitive integrations get <integration-id> # Get details
185
- primitive integrations update <id> [options] # Update integration
186
- primitive integrations delete <id> # Soft delete
187
191
  primitive integrations test <id> # Test connection
188
192
  primitive integrations logs <id> # View invocation logs
189
193
  ```
190
194
 
191
- **Create options:**
192
- - `--from-file <path>` - Load from TOML file
193
- - `--key <key>` - Integration key (identifier)
194
- - `--name <name>` - Display name
195
- - `--base-url <url>` - Base URL for API calls
196
- - `--timeout <ms>` - Request timeout in milliseconds
197
-
198
- **Secrets management:**
199
-
200
- Integration-scoped secrets are **deprecated** and can no longer be created. Use
201
- app-level secrets instead (`primitive secrets set <KEY> --value <value>`) and reference
202
- them in integration config via `{{secrets.KEY}}`. See the **Secrets** section
203
- below. The remaining integration-secret commands only list/archive legacy
204
- secrets:
195
+ An integration is authored in `integrations/<key>.toml` and applied with
196
+ `config push` creating, updating and deleting one are all edits to that file:
205
197
 
206
198
  ```bash
207
- primitive integrations secrets list <integration-id>
208
- primitive integrations secrets archive <id> <secret-id>
199
+ primitive config fields integration # its keys, types, defaults
200
+ primitive config create integration weather-api # scaffold the file
201
+ primitive config push --only integration/weather-api
209
202
  ```
210
203
 
204
+ **Secrets management:**
205
+
206
+ Integration-scoped secrets are **retired** — the `primitive integrations secrets`
207
+ command group no longer exists. Use app-level secrets instead
208
+ (`primitive secrets set <KEY> --value <value>`) and reference them in integration
209
+ config via `{{secrets.KEY}}`. See the **Secrets** section below.
210
+
211
211
  ### Secrets
212
212
 
213
213
  Manage encrypted app secrets (API keys, tokens, credentials). Values are encrypted at rest and never displayed after creation.
@@ -234,29 +234,25 @@ Manage LLM prompt configurations.
234
234
 
235
235
  ```bash
236
236
  primitive prompts list [app-id] # List prompts
237
- primitive prompts create [app-id] [options] # Create prompt
238
237
  primitive prompts get <prompt-id> # Get details
239
- primitive prompts update <id> [options] # Update prompt
240
- primitive prompts delete <id> # Soft delete
241
238
  primitive prompts execute <id> --vars '{}' # Execute prompt
242
239
  primitive prompts preview <id> --vars '{}' # Preview rendered template
243
240
  ```
244
241
 
245
- **Create options:**
246
- - `--from-file <path>` - Load from TOML file
247
- - `--key <key>` - Prompt key (identifier)
248
- - `--name <name>` - Display name
249
- - `--provider <provider>` - LLM provider (openrouter, gemini)
250
- - `--model <model>` - Model name
251
- - `--system-prompt <text>` - System prompt
252
- - `--user-template <text>` - User prompt template
242
+ A prompt is authored in `prompts/<key>.toml` and applied with `config push`:
243
+
244
+ ```bash
245
+ primitive config create prompt summarizer
246
+ primitive config push --only prompt/summarizer
247
+ ```
248
+
249
+ **Configs (prompt variations)** are `[[configs]]` entries in that same file —
250
+ `active = true` marks the live one, `status = "archived"` retires one, and
251
+ duplicating is copying the block under a new `name`. The CLI reads them:
253
252
 
254
- **Configs (prompt variations):**
255
253
  ```bash
256
254
  primitive prompts configs list <prompt-id>
257
- primitive prompts configs create <prompt-id> [options]
258
- primitive prompts configs activate <prompt-id> <config-id>
259
- primitive prompts configs duplicate <prompt-id> <config-id>
255
+ primitive prompts configs get <prompt> <config>
260
256
  ```
261
257
 
262
258
  ### Workflows
@@ -265,24 +261,34 @@ Manage multi-step workflow definitions.
265
261
 
266
262
  ```bash
267
263
  primitive workflows list [app-id] # List workflows
268
- primitive workflows create [app-id] --from-file wf.toml # Create workflow
269
264
  primitive workflows get <workflow-id> # Get details
270
- primitive workflows update <id> [options] # Update metadata
271
- primitive workflows draft update <id> --from-file wf.toml # Update draft
272
- primitive workflows publish <id> # Publish draft
273
265
  primitive workflows preview <id> --input '{}' # Preview execution
266
+ primitive workflows disable <id> # Take it out of service now
267
+ primitive workflows enable <id> # Put it back
268
+ ```
269
+
270
+ A workflow is authored in `workflows/<key>.toml` (named config bodies in
271
+ `workflows/<key>.configs/<name>.toml`) and applied with `config push`:
272
+
273
+ ```bash
274
+ primitive config create workflow process-doc
275
+ primitive config push --only workflow/process-doc
274
276
  ```
275
277
 
278
+ Revisions are read-only history from the retired legacy path (issue #2768:
279
+ `workflows publish` and its endpoint are gone). A workflow created before the
280
+ configuration model — one with no active config — is migrated by authoring
281
+ `workflows/<key>.configs/<name>.toml`, setting `activeConfigName = "<name>"` in
282
+ `workflows/<key>.toml`, and pushing.
283
+
276
284
  **Run management:**
277
285
  ```bash
278
286
  primitive workflows runs list <workflow-id>
279
287
  primitive workflows runs status <workflow-id> <run-id>
280
288
  ```
281
289
 
282
- **Workflow TOML push-time validation (issue #685):** Every command that
283
- pushes a workflow TOML (`workflows create --from-file`,
284
- `workflows draft update --from-file`, `workflows configs create --from-file`,
285
- `workflows configs update --from-file`, and `primitive sync push`) runs the
290
+ **Workflow TOML push-time validation (issue #685):** `primitive config push` —
291
+ the only command that sends a workflow TOML since #2645 — runs the
286
292
  file through `cli/src/lib/workflow-toml-validator.ts` before sending it to
287
293
  the server. For a step whose `kind` the CLI knows about, the validator
288
294
  rejects any top-level field outside the allowlist — most commonly catching
@@ -312,6 +318,46 @@ drift (#685/#802/#971) cannot recur. When you add a new step kind or a runner
312
318
  starts reading a new field, just regenerate and commit the artifact — there is
313
319
  no hand-maintained list to update.
314
320
 
321
+ **A configuration object's field surface has ONE definition (issue #2644):**
322
+ `src/config-surface/` on the server records, per configuration object, which
323
+ `models.yaml` fields exist, which TOML key each carries, which modes the server
324
+ accepts it in, and — for a field with real behavior — the handler that owns it.
325
+ The server's create/update handlers take their accepted key set from it
326
+ (`pickWritableFields`), and `cli/scripts/gen-config-surfaces.mjs` vendors the
327
+ same modules into the committed artifact
328
+ `cli/src/lib/generated-config-surfaces.ts`, which the CLI's push builder, pull
329
+ serializer and TOML key validation read. The generator runs automatically at CLI
330
+ `prebuild`; regenerate manually with `node cli/scripts/gen-config-surfaces.mjs`
331
+ (or `pnpm -C cli gen:config-surfaces`).
332
+
333
+ Three hard-fail checks live in `cli/tests/unit/config-surface-drift-guard.test.ts`:
334
+ freshness (`--check`, a byte comparison), coverage (every model field of every
335
+ registered object is either exposed or classified `notExposed` **with a
336
+ reason**), and registry existence (every `SYNC_RESOURCE_TYPES` label has a
337
+ definition — the migration's `PENDING_MIGRATION` exemption list is gone, so
338
+ there is nowhere to park one). Add a
339
+ field to `models.yaml` and the CLI unit suite fails until you regenerate and
340
+ classify it — so the CLI can no longer silently drop a new server-side field.
341
+ This supersedes the workflow-only descriptor and generator from #2326.
342
+
343
+ **Template expressions are linted at push time (issue #2689):** the validator
344
+ also inspects every `{{ }}` expression on a step and rejects the ones that can
345
+ never resolve — an unknown root (`{{ inputs.userId }}`; the valid roots are
346
+ `input`, `steps`, `outputs`, `meta`, `secrets`, `vars`, plus the contextual
347
+ `selected`/`user`/`md`, the built-ins `now`/`today`/`uuid`/`ulid`, and — inside a
348
+ forEach step's body only — `iteration`/`loop` and the loop's binding name) or a
349
+ reference to a `steps.<id>` / `outputs.<name>` the file does not declare. An
350
+ expression that is only sometimes present is marked optional with
351
+ `| default: ''` or a trailing `|| ''`, and anything statically undecidable (a
352
+ dynamic bracket key) is left to the run-time check. The lint itself is a
353
+ verbatim generated copy of the server module
354
+ `src/workflows/runner/template-static-lint.ts` at
355
+ `cli/src/lib/generated-template-lint.ts` (`cli/scripts/gen-template-lint.mjs`,
356
+ run at `prebuild`, with a `--check` freshness mode asserted by
357
+ `cli/tests/unit/template-lint-drift-guard.test.ts`), so the CLI's push-time
358
+ verdict and the server's save-time verdict come from the same code.
359
+
360
+
315
361
  ### Tokens
316
362
 
317
363
  Manage long-lived API access tokens for headless/server authentication.
@@ -364,6 +410,8 @@ primitive databases operations execute <database-id> <op-name> --token <jwt> #
364
410
 
365
411
  The `--token` flag lets you execute an operation as a specific user using a test JWT from `users mint-jwt`. Useful for testing access rules.
366
412
 
413
+ Under `--json`, the printed shape is the operation's own. A `query` — and a `pipeline` whose `returnField` names a query step — prints the CLI's list envelope `{ items, hasMore, nextCursor? }`, the same shape as `databases records query --json`. Every other operation type prints unchanged: `count` → `{ count }`, `aggregate` → `{ result }`, mutation → `{ results }`, `applyToQuery` → `{ matched, affected, failed, … }`, and a `returnField = "all"` pipeline → `{ steps: { … } }` with each step's own keys left alone. `--timing` adds `_timing` alongside whichever shape you get.
414
+
367
415
  **Records (schema introspection):**
368
416
  ```bash
369
417
  primitive databases records models <database-id> [app-id] # List model names
@@ -383,7 +431,7 @@ primitive databases export [app-id] <database-id> --output <dir> # Export r
383
431
  primitive databases import [app-id] <path> --overwrite --dry-run # Import from export directory
384
432
  ```
385
433
 
386
- Export creates a directory with `metadata.json`, `records.jsonl`, `indexes.json`, and `constraints.json`. Import restores records and indexes into a new or existing database. Database type config (operations, triggers, access rules) is managed separately via `primitive sync` — run `sync push` on the target app before importing.
434
+ Export creates a directory with `metadata.json`, `records.jsonl`, `indexes.json`, and `constraints.json`. Import restores records and indexes into a new or existing database. Database type config (operations, triggers, access rules) is managed separately via `primitive config` — run `config push` on the target app before importing.
387
435
 
388
436
  ### Documents
389
437
 
@@ -512,15 +560,15 @@ primitive catalog integrations update <catalog-id> [options]
512
560
  primitive catalog integrations delete <catalog-id>
513
561
  ```
514
562
 
515
- ### Sync (TOML Configuration)
563
+ ### Config (TOML Configuration)
516
564
 
517
- Sync app configuration to/from TOML files for version control.
565
+ Author app configuration as TOML files and reconcile them with the server.
518
566
 
519
567
  ```bash
520
- primitive sync init [app-id] --dir ./config # Initialize config directory
521
- primitive sync pull [app-id] --dir ./config # Pull remote config to local
522
- primitive sync push [app-id] --dir ./config # Push local config to remote
523
- primitive sync diff [app-id] --dir ./config # Show differences
568
+ primitive config init [app-id] --dir ./config # Initialize config directory
569
+ primitive config pull [app-id] --dir ./config # Pull remote config to local
570
+ primitive config push [app-id] --dir ./config # Push local config to remote
571
+ primitive config diff [app-id] --dir ./config # Show differences
524
572
  ```
525
573
 
526
574
  **Options:**
@@ -556,8 +604,7 @@ baseUrl = "https://myapp.com"
556
604
  [auth]
557
605
  googleOAuthEnabled = true
558
606
  passkeyEnabled = true
559
- magicLinkEnabled = false
560
- otpEnabled = true # email one-time-passcode sign-in
607
+ emailSignInEnabled = true # one email carrying a code and a link
561
608
  appleSignInEnabled = true # Sign in with Apple
562
609
  appleAudiences = ["com.example.MyApp"] # allowed Apple audiences
563
610
 
@@ -571,7 +618,7 @@ Notes on `[auth]`:
571
618
 
572
619
  - Only keys you actually list are pushed. Omitting a key leaves the server's
573
620
  current value untouched — it is **not** reset to `false`. To turn a method
574
- off, set it explicitly (e.g. `magicLinkEnabled = false`).
621
+ off, set it explicitly (e.g. `emailSignInEnabled = false`).
575
622
  - An unrecognized `[auth]` key (for example a typo like `googleOauthEnabled`)
576
623
  produces a warning on `push` and is ignored, rather than being silently
577
624
  dropped. The push still applies the recognized keys.
@@ -587,7 +634,6 @@ Notes on `[auth]`:
587
634
  key = "weather-api"
588
635
  displayName = "Weather API"
589
636
  description = "OpenWeatherMap integration"
590
- status = "active"
591
637
  timeoutMs = 30000
592
638
 
593
639
  [requestConfig]
@@ -603,7 +649,6 @@ allowedPaths = ["/weather", "/forecast"]
603
649
  key = "summarizer"
604
650
  displayName = "Text Summarizer"
605
651
  description = "Summarizes input text"
606
- status = "active"
607
652
 
608
653
  [[configs]]
609
654
  name = "default"
@@ -687,7 +732,7 @@ Shape (`schemaVersion: 1`):
687
732
  "schemaVersion": 1,
688
733
  "name": "primitive",
689
734
  "version": "1.0.49",
690
- "globalOptions": [ { "flags": "-e, --env <name>", "description": "…", "required": true, "defaultValue": null } ],
735
+ "globalOptions": [ { "flags": "-e, --env <name>", "description": "…", "required": true, "defaultValue": null, "hidden": false } ],
691
736
  "commands": [
692
737
  {
693
738
  "name": "sync",
@@ -701,7 +746,7 @@ Shape (`schemaVersion: 1`):
701
746
  "description": "…",
702
747
  "aliases": [],
703
748
  "args": [ { "name": "app-id", "required": false, "variadic": false, "description": "…" } ],
704
- "options": [ { "flags": "--dir <path>", "description": "…", "required": true, "defaultValue": null } ],
749
+ "options": [ { "flags": "--dir <path>", "description": "…", "required": true, "defaultValue": null, "hidden": false } ],
705
750
  "commands": []
706
751
  }
707
752
  ]
@@ -710,6 +755,10 @@ Shape (`schemaVersion: 1`):
710
755
  }
711
756
  ```
712
757
 
758
+ `hidden` marks a deprecated alias that still works but is not part of the
759
+ supported surface (it is omitted from human `--help` too). Tooling that treats
760
+ the manifest as an allowlist — the docs CLI gate does — should skip those flags.
761
+
713
762
  `schemaVersion` is the contract knob: consumers assert the shape they understand
714
763
  and fail loud if a future CLI bumps it (a breaking change for downstream tooling
715
764
  such as docs CI that drift-gates documented invocations against the published
@@ -717,7 +766,7 @@ CLI).
717
766
 
718
767
  ### `primitive-admin/validators` — TOML validators
719
768
 
720
- The TOML validators that `sync push` runs as its load-bearing gate are exported
769
+ The TOML validators that `config push` runs as its load-bearing gate are exported
721
770
  from the `primitive-admin/validators` subpath (ESM-only, with types) so external
722
771
  tooling can validate exactly the way the published CLI does — instead of
723
772
  re-implementing the flow and silently drifting.
@@ -737,8 +786,8 @@ Two contracts:
737
786
  - **`validateWorkflowTomlSource(raw, filePath)`** — pass the **raw TOML source
738
787
  string** and the workflow's path. It runs the *identical* parse →
739
788
  `expandWorkflowTomlData()` (`include` fragment expansion) → `validateWorkflowToml`
740
- → `formatWorkflowTomlErrors` path that `sync push` runs, so it cannot diverge
741
- from `sync push` on workflow `include` fragments. Returns
789
+ → `formatWorkflowTomlErrors` path that `config push` runs, so it cannot diverge
790
+ from `config push` on workflow `include` fragments. Returns
742
791
  `{ errors, formatted }` (`formatted` is `null` when valid). Fragment files
743
792
  resolve relative to `<filePath>/../../workflow-fragments/`, matching the CLI.
744
793
 
@@ -771,8 +820,10 @@ Internal helpers (`collectParamRefs`, `declaredParamNames`,
771
820
 
772
821
  **Login server resolution:**
773
822
  1. Project mode (`.primitive/config.json` present): the active environment's
774
- `apiUrl`. Select the environment with `-e <name>`, `PRIMITIVE_ENV`, or
775
- `defaultEnvironment`. An unresolvable environment fails loudly `login`
823
+ `apiUrl`. Select the environment with `-e <name>`, `PRIMITIVE_ENV`,
824
+ `primitive env use <name>` (this machine's selection, stored in the
825
+ gitignored `.primitive/local.json`), or the committed `defaultEnvironment`
826
+ — in that order. An unresolvable environment fails loudly — `login`
776
827
  never silently falls back to production.
777
828
  2. Legacy mode (no project config): `PRIMITIVE_SERVER_URL`, else the default
778
829
  `https://primitiveapi.com`.
@@ -784,6 +835,11 @@ Internal helpers (`collectParamRefs`, `declaredParamNames`,
784
835
 
785
836
  ## Development
786
837
 
838
+ Before adding or changing a command, read [`docs/cli-design.md`](../docs/cli-design.md)
839
+ in the repo root — the CLI's design rules (which verbs each kind of noun carries,
840
+ TOML-only authoring, deletion and naming rules, what a breaking change obliges).
841
+ It is internal maintainer guidance and is not published.
842
+
787
843
  ```bash
788
844
  # Run without building (uses tsx)
789
845
  pnpm run cli:dev -- login