@rebasepro/cli 0.31.0 → 0.33.0

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 (196) hide show
  1. package/dist/{agent-setup-DqAcoDcn.js → agent-setup-Cg_zBWoW.js} +3 -3
  2. package/dist/{agent-setup-DqAcoDcn.js.map → agent-setup-Cg_zBWoW.js.map} +1 -1
  3. package/dist/api-TbmW33D7.js +275 -0
  4. package/dist/api-TbmW33D7.js.map +1 -0
  5. package/dist/{api-keys-eIUjMqWn.js → api-keys-fPQ55DCm.js} +151 -158
  6. package/dist/api-keys-fPQ55DCm.js.map +1 -0
  7. package/dist/{apps-DExO4PEl.js → apps-DBTRoOeP.js} +18 -13
  8. package/dist/apps-DBTRoOeP.js.map +1 -0
  9. package/dist/{args-CaCcrYE1.js → args-DHyrshtI.js} +3 -132
  10. package/dist/args-DHyrshtI.js.map +1 -0
  11. package/dist/{atlas-dev-database-DOCKk6ht.js → atlas-dev-database-D6h65f2x.js} +3 -3
  12. package/dist/{atlas-dev-database-DOCKk6ht.js.map → atlas-dev-database-D6h65f2x.js.map} +1 -1
  13. package/dist/{auth-ofQETpM5.js → auth-BpyYLEFY.js} +93 -12
  14. package/dist/auth-BpyYLEFY.js.map +1 -0
  15. package/dist/auth-session-B6aT0Dyj.js +371 -0
  16. package/dist/auth-session-B6aT0Dyj.js.map +1 -0
  17. package/dist/{backend-guard-C0mVkXBw.js → backend-guard-Cf8eMK_f.js} +2 -2
  18. package/dist/{backend-guard-C0mVkXBw.js.map → backend-guard-Cf8eMK_f.js.map} +1 -1
  19. package/dist/{branch-pointer-DMPyvZoK.js → branch-pointer-BJOF2Ubv.js} +1 -1
  20. package/dist/{build-CA5R07tw.js → build-E5hfEWKj.js} +23 -10
  21. package/dist/build-E5hfEWKj.js.map +1 -0
  22. package/dist/{bundle-DgILeA5b.js → bundle-CIiKGrte.js} +78 -12
  23. package/dist/bundle-CIiKGrte.js.map +1 -0
  24. package/dist/bundle.d.ts +31 -1
  25. package/dist/{cloud-CYMk92iG.js → cloud-DNJyUU0T.js} +1715 -1516
  26. package/dist/cloud-DNJyUU0T.js.map +1 -0
  27. package/dist/{cms-directories-BK3vcswg.js → cms-directories-BaV-Is9a.js} +2 -2
  28. package/dist/{cms-directories-BK3vcswg.js.map → cms-directories-BaV-Is9a.js.map} +1 -1
  29. package/dist/codemod/collections-to-tables/backend.d.ts +0 -2
  30. package/dist/codemod/collections-to-tables/customization.d.ts +7 -1
  31. package/dist/codemod/collections-to-tables/modules.d.ts +32 -0
  32. package/dist/codemod/collections-to-tables/plan-context.d.ts +7 -1
  33. package/dist/{command-D5lhW_-B.js → command-Bks5xkrQ.js} +89 -44
  34. package/dist/command-Bks5xkrQ.js.map +1 -0
  35. package/dist/commands/api-keys.d.ts +89 -52
  36. package/dist/commands/api.d.ts +114 -0
  37. package/dist/commands/auth-session.d.ts +94 -0
  38. package/dist/commands/auth.d.ts +1 -1
  39. package/dist/commands/cloud/alerts.d.ts +29 -0
  40. package/dist/commands/cloud/context.d.ts +8 -0
  41. package/dist/commands/cloud/debug.d.ts +16 -1
  42. package/dist/commands/cloud/deploy-hooks.d.ts +19 -0
  43. package/dist/commands/cloud/deploy.d.ts +25 -0
  44. package/dist/commands/cloud/env.d.ts +12 -1
  45. package/dist/commands/cloud/index.d.ts +5 -0
  46. package/dist/commands/cloud/maintenance.d.ts +26 -1
  47. package/dist/commands/cloud/not-served.d.ts +27 -0
  48. package/dist/commands/cloud/orgs.d.ts +5 -0
  49. package/dist/commands/cloud/resources.d.ts +82 -2
  50. package/dist/commands/cloud/runtime-logs.d.ts +57 -0
  51. package/dist/commands/cloud/service-key.d.ts +33 -1
  52. package/dist/commands/cloud/settings.d.ts +3 -0
  53. package/dist/commands/cron.d.ts +68 -0
  54. package/dist/commands/data.d.ts +197 -0
  55. package/dist/commands/functions.d.ts +38 -0
  56. package/dist/commands/logs.d.ts +22 -0
  57. package/dist/commands/rls.d.ts +31 -0
  58. package/dist/commands/schema-reconcile.d.ts +2 -1
  59. package/dist/commands/schema-show.d.ts +38 -0
  60. package/dist/commands/storage-objects.d.ts +88 -0
  61. package/dist/commands/storage.d.ts +18 -2
  62. package/dist/commands/users.d.ts +147 -0
  63. package/dist/{consent-BXLIrMl8.js → consent-UV6ObCME.js} +2 -2
  64. package/dist/{consent-BXLIrMl8.js.map → consent-UV6ObCME.js.map} +1 -1
  65. package/dist/{console-DjThnr3f.js → console-BVoYOLAO.js} +6 -6
  66. package/dist/{console-DjThnr3f.js.map → console-BVoYOLAO.js.map} +1 -1
  67. package/dist/{context--JwaHaZp.js → context-BOMEoKxn.js} +80 -9
  68. package/dist/{context--JwaHaZp.js.map → context-BOMEoKxn.js.map} +1 -1
  69. package/dist/cron-CpUsQ739.js +298 -0
  70. package/dist/cron-CpUsQ739.js.map +1 -0
  71. package/dist/cron-ZRXsla0v.js +259 -0
  72. package/dist/cron-ZRXsla0v.js.map +1 -0
  73. package/dist/{daemon-w30PsdwV.js → daemon-D5gdG7gx.js} +3 -3
  74. package/dist/{daemon-w30PsdwV.js.map → daemon-D5gdG7gx.js.map} +1 -1
  75. package/dist/{daemon-entry-zOC1revO.js → daemon-entry--ummUJnk.js} +2 -2
  76. package/dist/{daemon-entry-zOC1revO.js.map → daemon-entry--ummUJnk.js.map} +1 -1
  77. package/dist/data-BJ9AZFUC.js +947 -0
  78. package/dist/data-BJ9AZFUC.js.map +1 -0
  79. package/dist/{db-Bz2RFGJj.js → db-D_iF4E-v.js} +38 -34
  80. package/dist/{db-Bz2RFGJj.js.map → db-D_iF4E-v.js.map} +1 -1
  81. package/dist/debug-nNbbxAeo.js +1114 -0
  82. package/dist/debug-nNbbxAeo.js.map +1 -0
  83. package/dist/{derive-C3ezmY-p.js → derive-Mky_u59_.js} +3 -3
  84. package/dist/{derive-C3ezmY-p.js.map → derive-Mky_u59_.js.map} +1 -1
  85. package/dist/{dev-D8TxrE_I.js → dev-bj6dEeSQ.js} +13 -13
  86. package/dist/{dev-D8TxrE_I.js.map → dev-bj6dEeSQ.js.map} +1 -1
  87. package/dist/dev-db/pull.d.ts +13 -3
  88. package/dist/{dev-preflight-DjvcV6SK.js → dev-preflight-BMOf2N6r.js} +2 -2
  89. package/dist/{dev-preflight-DjvcV6SK.js.map → dev-preflight-BMOf2N6r.js.map} +1 -1
  90. package/dist/{dev-server-BLxCbQEP.js → dev-server-2XHSHM_q.js} +2 -2
  91. package/dist/{dev-server-BLxCbQEP.js.map → dev-server-2XHSHM_q.js.map} +1 -1
  92. package/dist/{doctor-Du-mSxoE.js → doctor-FaBObSlb.js} +29 -10
  93. package/dist/doctor-FaBObSlb.js.map +1 -0
  94. package/dist/doctor-environment.d.ts +9 -0
  95. package/dist/{eject-Bhzd6hgb.js → eject-DK_M9kor.js} +4 -4
  96. package/dist/{eject-Bhzd6hgb.js.map → eject-DK_M9kor.js.map} +1 -1
  97. package/dist/{fold-static-CKewnAPX.js → fold-static-2t3UUX4z.js} +10 -6
  98. package/dist/fold-static-2t3UUX4z.js.map +1 -0
  99. package/dist/fold-static.d.ts +7 -0
  100. package/dist/functions-B4JR6EZL.js +120 -0
  101. package/dist/functions-B4JR6EZL.js.map +1 -0
  102. package/dist/{generate-view-CTOluXvH.js → generate-view-BMaLQm8H.js} +5 -5
  103. package/dist/{generate-view-CTOluXvH.js.map → generate-view-BMaLQm8H.js.map} +1 -1
  104. package/dist/{generate_sdk-De-aLC1L.js → generate_sdk-ByD-gTsK.js} +7 -7
  105. package/dist/{generate_sdk-De-aLC1L.js.map → generate_sdk-ByD-gTsK.js.map} +1 -1
  106. package/dist/index.es.js +123 -47
  107. package/dist/index.es.js.map +1 -1
  108. package/dist/{init-Dtl-IcXf.js → init-DHCe5mJ5.js} +59 -11
  109. package/dist/init-DHCe5mJ5.js.map +1 -0
  110. package/dist/{invoked-command-CG_rIa_o.js → invoked-command-FBeIBS8o.js} +2 -2
  111. package/dist/{invoked-command-CG_rIa_o.js.map → invoked-command-FBeIBS8o.js.map} +1 -1
  112. package/dist/last-dev-database-CBVkEUEl.js +2 -0
  113. package/dist/legacy-layout-DI2VeQSV.js +36 -0
  114. package/dist/legacy-layout-DI2VeQSV.js.map +1 -0
  115. package/dist/logs-DpuMukJe.js +192 -0
  116. package/dist/logs-DpuMukJe.js.map +1 -0
  117. package/dist/{manifest-C3uLDrrJ.js → manifest-RjqxfCpb.js} +114 -5
  118. package/dist/manifest-RjqxfCpb.js.map +1 -0
  119. package/dist/{migrate-VrKoi3nB.js → migrate-CSY9ZDKy.js} +5 -4
  120. package/dist/{migrate-VrKoi3nB.js.map → migrate-CSY9ZDKy.js.map} +1 -1
  121. package/dist/{normalize-imports-DwxqEMYq.js → normalize-imports-P86NVfpo.js} +3 -3
  122. package/dist/{normalize-imports-DwxqEMYq.js.map → normalize-imports-P86NVfpo.js.map} +1 -1
  123. package/dist/{path-flags-7O5uPBcQ.js → path-flags-ekLdkbra.js} +3 -3
  124. package/dist/{path-flags-7O5uPBcQ.js.map → path-flags-ekLdkbra.js.map} +1 -1
  125. package/dist/{prepare-Ccxspoj-.js → prepare-BaJe0Zik.js} +4 -4
  126. package/dist/{prepare-Ccxspoj-.js.map → prepare-BaJe0Zik.js.map} +1 -1
  127. package/dist/{project-CLcF5i8c.js → project-DALmhb5R.js} +2 -2
  128. package/dist/{project-CLcF5i8c.js.map → project-DALmhb5R.js.map} +1 -1
  129. package/dist/project-command-Cl9EZzjr.js +662 -0
  130. package/dist/project-command-Cl9EZzjr.js.map +1 -0
  131. package/dist/{project-schema-CsSOG2gE.js → project-schema-Dm6Jk0Y_.js} +4 -2
  132. package/dist/{project-schema-CsSOG2gE.js.map → project-schema-Dm6Jk0Y_.js.map} +1 -1
  133. package/dist/{pull-BMuiUyjb.js → pull-CTIsST6T.js} +66 -5
  134. package/dist/pull-CTIsST6T.js.map +1 -0
  135. package/dist/resolve-C36px9tR.js +2 -0
  136. package/dist/{resources-Dpfs2y8P.js → resources-Db3USuPO.js} +5 -5
  137. package/dist/{resources-Dpfs2y8P.js.map → resources-Db3USuPO.js.map} +1 -1
  138. package/dist/rls-BxrQ0P50.js +133 -0
  139. package/dist/rls-BxrQ0P50.js.map +1 -0
  140. package/dist/{schema-Dv6nHkb0.js → schema-_FzZEoB8.js} +54 -40
  141. package/dist/schema-_FzZEoB8.js.map +1 -0
  142. package/dist/{schema-dir-Cd1kvYbf.js → schema-dir-ChcYfWjP.js} +2 -2
  143. package/dist/{schema-dir-Cd1kvYbf.js.map → schema-dir-ChcYfWjP.js.map} +1 -1
  144. package/dist/schema-reconcile-DV14XY4o.js +2 -0
  145. package/dist/schema-show-h72UJ9zH.js +127 -0
  146. package/dist/schema-show-h72UJ9zH.js.map +1 -0
  147. package/dist/{skills-CXjA9TWw.js → skills-DQ2bZGkj.js} +6 -5
  148. package/dist/{skills-CXjA9TWw.js.map → skills-DQ2bZGkj.js.map} +1 -1
  149. package/dist/star-nudge.d.ts +28 -0
  150. package/dist/{start-Bwbtt2W5.js → start-Cjx4W0bJ.js} +7 -7
  151. package/dist/{start-Bwbtt2W5.js.map → start-Cjx4W0bJ.js.map} +1 -1
  152. package/dist/{status-BTgTWzlQ.js → status-CDBk25VO.js} +9 -9
  153. package/dist/{status-BTgTWzlQ.js.map → status-CDBk25VO.js.map} +1 -1
  154. package/dist/{storage-iTqj5-Av.js → storage-Clc8dLG8.js} +79 -36
  155. package/dist/storage-Clc8dLG8.js.map +1 -0
  156. package/dist/storage-objects-CfRKlTDe.js +279 -0
  157. package/dist/storage-objects-CfRKlTDe.js.map +1 -0
  158. package/dist/{telemetry-BP_1Cl9r.js → telemetry-DZU2-NCm.js} +5 -4
  159. package/dist/{telemetry-BP_1Cl9r.js.map → telemetry-DZU2-NCm.js.map} +1 -1
  160. package/dist/{telemetry-M3HjlyhZ.js → telemetry-EVtASbKb.js} +2 -2
  161. package/dist/{telemetry-M3HjlyhZ.js.map → telemetry-EVtASbKb.js.map} +1 -1
  162. package/dist/unknown-command-DnZ2uhGs.js +139 -0
  163. package/dist/unknown-command-DnZ2uhGs.js.map +1 -0
  164. package/dist/{upgrade-oZzJ13jM.js → upgrade-ZASvgxWM.js} +41 -9
  165. package/dist/{upgrade-oZzJ13jM.js.map → upgrade-ZASvgxWM.js.map} +1 -1
  166. package/dist/users-5PkqBY6R.js +561 -0
  167. package/dist/users-5PkqBY6R.js.map +1 -0
  168. package/dist/utils/legacy-layout.d.ts +22 -0
  169. package/dist/utils/project-command.d.ts +38 -0
  170. package/dist/utils/project-target.d.ts +193 -0
  171. package/dist/{verify-BkUVGLqo.js → verify-BdeqNb-V.js} +138 -12
  172. package/dist/verify-BdeqNb-V.js.map +1 -0
  173. package/dist/{version-Buyyo1ut.js → version-ONIeo7jl.js} +7 -2
  174. package/dist/{version-Buyyo1ut.js.map → version-ONIeo7jl.js.map} +1 -1
  175. package/package.json +10 -10
  176. package/templates/overlays/baas/backend/package.json +3 -1
  177. package/templates/template/backend/package.json +3 -1
  178. package/dist/api-keys-eIUjMqWn.js.map +0 -1
  179. package/dist/apps-DExO4PEl.js.map +0 -1
  180. package/dist/args-CaCcrYE1.js.map +0 -1
  181. package/dist/auth-ofQETpM5.js.map +0 -1
  182. package/dist/build-CA5R07tw.js.map +0 -1
  183. package/dist/bundle-DgILeA5b.js.map +0 -1
  184. package/dist/cloud-CYMk92iG.js.map +0 -1
  185. package/dist/command-D5lhW_-B.js.map +0 -1
  186. package/dist/doctor-Du-mSxoE.js.map +0 -1
  187. package/dist/fold-static-CKewnAPX.js.map +0 -1
  188. package/dist/init-Dtl-IcXf.js.map +0 -1
  189. package/dist/last-dev-database-Dc8cP01o.js +0 -2
  190. package/dist/manifest-C3uLDrrJ.js.map +0 -1
  191. package/dist/pull-BMuiUyjb.js.map +0 -1
  192. package/dist/resolve-BY7bSFRT.js +0 -2
  193. package/dist/schema-Dv6nHkb0.js.map +0 -1
  194. package/dist/schema-reconcile-CjxLaRHB.js +0 -2
  195. package/dist/storage-iTqj5-Av.js.map +0 -1
  196. package/dist/verify-BkUVGLqo.js.map +0 -1
package/dist/index.es.js CHANGED
@@ -1,10 +1,11 @@
1
- import { i as recordEvent, n as isEnabled, u as errorClass } from "./telemetry-M3HjlyhZ.js";
2
- import { n as parseCommandArgs, s as unknownCommand, t as UsageError } from "./args-CaCcrYE1.js";
3
- import { i as failAsJson, p as requireProjectRoot, y as wantsJsonOutput } from "./project-CLcF5i8c.js";
4
- import { C as resolveBackendPaths, D as validateManifest, E as synthesizeManifest, O as writeManifest, S as manifestPath, T as staticAppAddress, _ as findBackendApp, a as DEFAULT_TABLES_DIR, b as loadManifest, c as LEGACY_CONFIG_DIR, d as STORAGE_FILE, f as TABLES_INDEX_FILES, g as compareMountOrder, h as cmsMountOf, i as DEFAULT_SCHEMA_FILE, l as ManifestError, m as buildableApps, n as DEFAULT_CRONS_DIR, o as GENERATED_DIR, p as assessManagedCompatibility, r as DEFAULT_FUNCTIONS_DIR, s as HOOKS_FILE, t as CURRENT_RUNTIME_RANGE, u as RESOURCES_FILE, v as findTablesIndex, w as selectDeployApp, x as manifestExists, y as formatAppAddress } from "./manifest-C3uLDrrJ.js";
5
- import { a as refuseRemovedCollectionsFlag } from "./path-flags-7O5uPBcQ.js";
6
- import { n as cliVersion } from "./version-Buyyo1ut.js";
7
- import { C as unvendoredReason, S as normalizeEsmSpecifiers, _ as detectFrameworkDepDrift, a as VENDOR_SIZE_WARN_BYTES, b as findUnusedServerEntry, c as buildBundle, d as bundledNpmrc, f as collectDeclaredDependencies, g as detectDeclaredDepConflicts, h as describeDepConflicts, i as VENDOR_SIZE_MAX_BYTES, l as buildStaticBundle, m as composeBundleManifest, n as DEFAULT_BUNDLE_DIR, o as VENDOR_TARGET_CPU, p as commentSpans, r as UNVENDORED_COST, s as VENDOR_TARGET_OS, t as BUNDLED_UI_CONFIG, u as bundleUiConfig, v as detectNativeDependencies, w as vendorDependencies, x as foldStaticIntoBundle, y as detectStorageAuthorize } from "./bundle-DgILeA5b.js";
1
+ import { i as recordEvent, n as isEnabled, u as errorClass } from "./telemetry-EVtASbKb.js";
2
+ import { n as unknownCommand } from "./unknown-command-DnZ2uhGs.js";
3
+ import { n as parseCommandArgs, t as UsageError } from "./args-DHyrshtI.js";
4
+ import { i as failAsJson, p as requireProjectRoot, y as wantsJsonOutput } from "./project-DALmhb5R.js";
5
+ import { C as resolveBackendPaths, D as validateManifest, E as synthesizeManifest, O as writeManifest, S as manifestPath, T as staticAppAddress, _ as findBackendApp, a as DEFAULT_TABLES_DIR, b as loadManifest, c as LEGACY_CONFIG_DIR, d as STORAGE_FILE, f as TABLES_INDEX_FILES, g as compareMountOrder, h as cmsMountOf, i as DEFAULT_SCHEMA_FILE, l as ManifestError, m as buildableApps, n as DEFAULT_CRONS_DIR, o as GENERATED_DIR, p as assessManagedCompatibility, r as DEFAULT_FUNCTIONS_DIR, s as HOOKS_FILE, t as CURRENT_RUNTIME_RANGE, u as RESOURCES_FILE, v as findTablesIndex, w as selectDeployApp, x as manifestExists, y as formatAppAddress } from "./manifest-RjqxfCpb.js";
6
+ import { a as refuseRemovedCollectionsFlag } from "./path-flags-ekLdkbra.js";
7
+ import { n as cliVersion } from "./version-ONIeo7jl.js";
8
+ import { C as normalizeEsmSpecifiers, S as foldStaticIntoBundle, T as vendorDependencies, _ as detectFrameworkDepDrift, a as VENDOR_SIZE_WARN_BYTES, b as findIgnoredConfigStorageAuthorize, c as buildBundle, d as bundledNpmrc, f as collectDeclaredDependencies, g as detectDeclaredDepConflicts, h as describeDepConflicts, i as VENDOR_SIZE_MAX_BYTES, l as buildStaticBundle, m as composeBundleManifest, n as DEFAULT_BUNDLE_DIR, o as VENDOR_TARGET_CPU, p as commentSpans, r as UNVENDORED_COST, s as VENDOR_TARGET_OS, t as BUNDLED_UI_CONFIG, u as bundleUiConfig, v as detectNativeDependencies, w as unvendoredReason, x as findUnusedServerEntry, y as detectStorageAuthorize } from "./bundle-CIiKGrte.js";
8
9
  import chalk from "chalk";
9
10
  import arg from "arg";
10
11
  import path from "path";
@@ -75,7 +76,14 @@ var namespacedCommands = [
75
76
  "status",
76
77
  "upgrade",
77
78
  "migrate",
78
- "normalize-imports"
79
+ "normalize-imports",
80
+ "api",
81
+ "data",
82
+ "users",
83
+ "cron",
84
+ "logs",
85
+ "functions",
86
+ "rls"
79
87
  ];
80
88
  var NO_VOCABULARY = {
81
89
  subcommands: [],
@@ -93,47 +101,67 @@ var NO_VOCABULARY = {
93
101
  async function commandVocabulary(command) {
94
102
  switch (command) {
95
103
  case "schema": return {
96
- subcommands: (await import("./schema-Dv6nHkb0.js")).SCHEMA_SUBCOMMANDS,
104
+ subcommands: (await import("./schema-_FzZEoB8.js")).SCHEMA_SUBCOMMANDS,
97
105
  aliases: {}
98
106
  };
99
107
  case "db": return {
100
- subcommands: (await import("./db-Bz2RFGJj.js")).DB_SUBCOMMANDS,
108
+ subcommands: (await import("./db-D_iF4E-v.js")).DB_SUBCOMMANDS,
101
109
  aliases: {}
102
110
  };
103
111
  case "auth": return {
104
- subcommands: (await import("./auth-ofQETpM5.js")).AUTH_SUBCOMMANDS,
112
+ subcommands: (await import("./auth-BpyYLEFY.js")).AUTH_SUBCOMMANDS,
105
113
  aliases: {}
106
114
  };
107
115
  case "skills": return {
108
- subcommands: (await import("./skills-CXjA9TWw.js").then((n) => n.u)).SKILLS_SUBCOMMANDS,
116
+ subcommands: (await import("./skills-DQ2bZGkj.js").then((n) => n.u)).SKILLS_SUBCOMMANDS,
109
117
  aliases: {}
110
118
  };
111
119
  case "api-keys": return {
112
- subcommands: (await import("./api-keys-eIUjMqWn.js").then((n) => n.t)).API_KEYS_SUBCOMMANDS,
120
+ subcommands: (await import("./api-keys-fPQ55DCm.js").then((n) => n.t)).API_KEYS_SUBCOMMANDS,
113
121
  aliases: {}
114
122
  };
115
123
  case "storage": return {
116
- subcommands: (await import("./storage-iTqj5-Av.js")).STORAGE_SUBCOMMANDS,
124
+ subcommands: (await import("./storage-Clc8dLG8.js")).STORAGE_SUBCOMMANDS,
125
+ aliases: {}
126
+ };
127
+ case "data": return {
128
+ subcommands: (await import("./data-BJ9AZFUC.js")).DATA_SUBCOMMANDS,
129
+ aliases: {}
130
+ };
131
+ case "users": return {
132
+ subcommands: (await import("./users-5PkqBY6R.js")).USERS_SUBCOMMANDS,
133
+ aliases: {}
134
+ };
135
+ case "cron": return {
136
+ subcommands: (await import("./cron-CpUsQ739.js")).CRON_SUBCOMMANDS,
137
+ aliases: {}
138
+ };
139
+ case "functions": return {
140
+ subcommands: (await import("./functions-B4JR6EZL.js")).FUNCTIONS_SUBCOMMANDS,
141
+ aliases: {}
142
+ };
143
+ case "rls": return {
144
+ subcommands: (await import("./rls-BxrQ0P50.js")).RLS_SUBCOMMANDS,
117
145
  aliases: {}
118
146
  };
119
147
  case "apps": return {
120
- subcommands: (await import("./apps-DExO4PEl.js")).APPS_SUBCOMMANDS,
148
+ subcommands: (await import("./apps-DBTRoOeP.js")).APPS_SUBCOMMANDS,
121
149
  aliases: {}
122
150
  };
123
151
  case "telemetry": return {
124
- subcommands: (await import("./telemetry-BP_1Cl9r.js")).TELEMETRY_SUBCOMMANDS,
152
+ subcommands: (await import("./telemetry-DZU2-NCm.js")).TELEMETRY_SUBCOMMANDS,
125
153
  aliases: {}
126
154
  };
127
155
  case "generate": return {
128
- subcommands: (await import("./generate-view-CTOluXvH.js")).GENERATE_SUBCOMMANDS,
156
+ subcommands: (await import("./generate-view-BMaLQm8H.js")).GENERATE_SUBCOMMANDS,
129
157
  aliases: {}
130
158
  };
131
159
  case "migrate": return {
132
- subcommands: (await import("./migrate-VrKoi3nB.js")).MIGRATE_SUBCOMMANDS,
160
+ subcommands: (await import("./migrate-CSY9ZDKy.js")).MIGRATE_SUBCOMMANDS,
133
161
  aliases: {}
134
162
  };
135
163
  case "cloud": {
136
- const cloud = await import("./cloud-CYMk92iG.js");
164
+ const cloud = await import("./cloud-DNJyUU0T.js");
137
165
  return {
138
166
  subcommands: cloud.CLOUD_GROUP_NAMES,
139
167
  aliases: cloud.GROUP_ALIASES
@@ -256,12 +284,12 @@ async function entry(args) {
256
284
  async function dispatch(command, effectiveSubcommand, args, parsedArgs, namespacedCommands) {
257
285
  switch (command) {
258
286
  case "__dev-db-daemon": {
259
- const { parseDaemonArgs, runDaemon } = await import("./daemon-entry-zOC1revO.js");
287
+ const { parseDaemonArgs, runDaemon } = await import("./daemon-entry--ummUJnk.js");
260
288
  await runDaemon(parseDaemonArgs(args));
261
289
  return;
262
290
  }
263
291
  case "init": {
264
- const { createRebaseApp } = await import("./init-Dtl-IcXf.js");
292
+ const { createRebaseApp } = await import("./init-DHCe5mJ5.js");
265
293
  await createRebaseApp(args);
266
294
  break;
267
295
  }
@@ -283,9 +311,9 @@ async function dispatch(command, effectiveSubcommand, args, parsedArgs, namespac
283
311
  maxPositionals: 0
284
312
  });
285
313
  const sdkRoot = sdkHelp ? process.cwd() : requireProjectRoot();
286
- const { generateSdkCommand } = await import("./generate_sdk-De-aLC1L.js");
314
+ const { generateSdkCommand } = await import("./generate_sdk-ByD-gTsK.js");
287
315
  await generateSdkCommand({
288
- schemaDir: sdkArgs["--schema-dir"] || (sdkHelp ? sdkRoot : (await import("./schema-dir-Cd1kvYbf.js").then((n) => n.i)).resolveSchemaDir(sdkRoot)),
316
+ schemaDir: sdkArgs["--schema-dir"] || (sdkHelp ? sdkRoot : (await import("./schema-dir-ChcYfWjP.js").then((n) => n.i)).resolveSchemaDir(sdkRoot)),
289
317
  output: sdkArgs["--output"] || path.join(sdkRoot, "generated/sdk"),
290
318
  from: sdkArgs["--from"],
291
319
  token: sdkArgs["--token"],
@@ -297,116 +325,151 @@ async function dispatch(command, effectiveSubcommand, args, parsedArgs, namespac
297
325
  break;
298
326
  }
299
327
  case "schema": {
300
- const { schemaCommand } = await import("./schema-Dv6nHkb0.js");
328
+ const { schemaCommand } = await import("./schema-_FzZEoB8.js");
301
329
  await schemaCommand(effectiveSubcommand, args);
302
330
  break;
303
331
  }
304
332
  case "db": {
305
- const { dbCommand } = await import("./db-Bz2RFGJj.js");
333
+ const { dbCommand } = await import("./db-D_iF4E-v.js");
306
334
  await dbCommand(effectiveSubcommand, args);
307
335
  break;
308
336
  }
309
337
  case "console": {
310
- const { consoleCommand } = await import("./console-DjThnr3f.js");
338
+ const { consoleCommand } = await import("./console-BVoYOLAO.js");
311
339
  await consoleCommand(args);
312
340
  break;
313
341
  }
314
342
  case "dev": {
315
- const { devCommand } = await import("./dev-D8TxrE_I.js");
343
+ const { devCommand } = await import("./dev-bj6dEeSQ.js");
316
344
  await devCommand(args);
317
345
  break;
318
346
  }
319
347
  case "normalize-imports": {
320
- const { normalizeImportsCommand } = await import("./normalize-imports-DwxqEMYq.js");
348
+ const { normalizeImportsCommand } = await import("./normalize-imports-P86NVfpo.js");
321
349
  await normalizeImportsCommand(args);
322
350
  break;
323
351
  }
324
352
  case "build": {
325
- const { buildCommand } = await import("./build-CA5R07tw.js").then((n) => n.n);
353
+ const { buildCommand } = await import("./build-E5hfEWKj.js").then((n) => n.n);
326
354
  await buildCommand(args);
327
355
  break;
328
356
  }
329
357
  case "start": {
330
- const { startCommand } = await import("./start-Bwbtt2W5.js");
358
+ const { startCommand } = await import("./start-Cjx4W0bJ.js");
331
359
  await startCommand(args);
332
360
  break;
333
361
  }
334
362
  case "upgrade": {
335
- const { upgradeCommand } = await import("./upgrade-oZzJ13jM.js");
363
+ const { upgradeCommand } = await import("./upgrade-ZASvgxWM.js");
336
364
  await upgradeCommand(args);
337
365
  break;
338
366
  }
339
367
  case "migrate": {
340
- const { migrateCommand } = await import("./migrate-VrKoi3nB.js");
368
+ const { migrateCommand } = await import("./migrate-CSY9ZDKy.js");
341
369
  await migrateCommand(effectiveSubcommand, args);
342
370
  break;
343
371
  }
344
372
  case "apps": {
345
- const { appsCommand } = await import("./apps-DExO4PEl.js");
373
+ const { appsCommand } = await import("./apps-DBTRoOeP.js");
346
374
  await appsCommand(effectiveSubcommand, args);
347
375
  break;
348
376
  }
349
377
  case "generate": {
350
- const { generateCommand } = await import("./generate-view-CTOluXvH.js");
378
+ const { generateCommand } = await import("./generate-view-BMaLQm8H.js");
351
379
  await generateCommand(effectiveSubcommand, args);
352
380
  break;
353
381
  }
354
382
  case "eject": {
355
- const { ejectCommand } = await import("./eject-Bhzd6hgb.js");
383
+ const { ejectCommand } = await import("./eject-DK_M9kor.js");
356
384
  await ejectCommand(args);
357
385
  break;
358
386
  }
359
387
  case "auth": {
360
- const { authCommand } = await import("./auth-ofQETpM5.js");
388
+ const { authCommand } = await import("./auth-BpyYLEFY.js");
361
389
  await authCommand(effectiveSubcommand, args);
362
390
  break;
363
391
  }
364
392
  case "status": {
365
- const { statusCommand } = await import("./status-BTgTWzlQ.js");
393
+ const { statusCommand } = await import("./status-CDBk25VO.js");
366
394
  await statusCommand(args);
367
395
  break;
368
396
  }
369
397
  case "resources": {
370
- const { resourcesCommand } = await import("./resources-Dpfs2y8P.js");
398
+ const { resourcesCommand } = await import("./resources-Db3USuPO.js");
371
399
  await resourcesCommand(args);
372
400
  break;
373
401
  }
374
402
  case "doctor": {
375
- const { doctorCommand } = await import("./doctor-Du-mSxoE.js");
403
+ const { doctorCommand } = await import("./doctor-FaBObSlb.js");
376
404
  await doctorCommand(args);
377
405
  break;
378
406
  }
379
407
  case "verify": {
380
- const { verifyCommand } = await import("./verify-BkUVGLqo.js");
408
+ const { verifyCommand } = await import("./verify-BdeqNb-V.js");
381
409
  await verifyCommand(args);
382
410
  break;
383
411
  }
384
412
  case "skills": {
385
- const { skillsCommand } = await import("./skills-CXjA9TWw.js").then((n) => n.u);
413
+ const { skillsCommand } = await import("./skills-DQ2bZGkj.js").then((n) => n.u);
386
414
  await skillsCommand(effectiveSubcommand, args);
387
415
  break;
388
416
  }
389
417
  case "api-keys": {
390
- const { apiKeysCommand } = await import("./api-keys-eIUjMqWn.js").then((n) => n.t);
418
+ const { apiKeysCommand } = await import("./api-keys-fPQ55DCm.js").then((n) => n.t);
391
419
  await apiKeysCommand(effectiveSubcommand, args);
392
420
  break;
393
421
  }
394
422
  case "storage": {
395
- const { storageCommand } = await import("./storage-iTqj5-Av.js");
423
+ const { storageCommand } = await import("./storage-Clc8dLG8.js");
396
424
  await storageCommand(effectiveSubcommand, args);
397
425
  break;
398
426
  }
399
427
  case "cloud": {
400
- const { cloudCommand } = await import("./cloud-CYMk92iG.js");
428
+ const { cloudCommand } = await import("./cloud-DNJyUU0T.js");
401
429
  await cloudCommand(effectiveSubcommand, args);
402
430
  break;
403
431
  }
404
432
  case "telemetry": {
405
- const { telemetryCommand } = await import("./telemetry-BP_1Cl9r.js");
433
+ const { telemetryCommand } = await import("./telemetry-DZU2-NCm.js");
406
434
  await telemetryCommand(args);
407
435
  break;
408
436
  }
409
- default: unknownCommand(command, namespacedCommands, "", { cloud: (await import("./cloud-CYMk92iG.js")).CLOUD_GROUP_NAMES });
437
+ case "api": {
438
+ const { apiCommand } = await import("./api-TbmW33D7.js");
439
+ await apiCommand(args);
440
+ break;
441
+ }
442
+ case "data": {
443
+ const { dataCommand } = await import("./data-BJ9AZFUC.js");
444
+ await dataCommand(effectiveSubcommand, args);
445
+ break;
446
+ }
447
+ case "users": {
448
+ const { usersCommand } = await import("./users-5PkqBY6R.js");
449
+ await usersCommand(effectiveSubcommand, args);
450
+ break;
451
+ }
452
+ case "cron": {
453
+ const { cronCommand } = await import("./cron-CpUsQ739.js");
454
+ await cronCommand(effectiveSubcommand, args);
455
+ break;
456
+ }
457
+ case "logs": {
458
+ const { logsCommand } = await import("./logs-DpuMukJe.js");
459
+ await logsCommand(args);
460
+ break;
461
+ }
462
+ case "functions": {
463
+ const { functionsCommand } = await import("./functions-B4JR6EZL.js");
464
+ await functionsCommand(effectiveSubcommand, args);
465
+ break;
466
+ }
467
+ case "rls": {
468
+ const { rlsCommand } = await import("./rls-BxrQ0P50.js");
469
+ await rlsCommand(effectiveSubcommand, args);
470
+ break;
471
+ }
472
+ default: unknownCommand(command, namespacedCommands, "", { cloud: (await import("./cloud-DNJyUU0T.js")).CLOUD_GROUP_NAMES });
410
473
  }
411
474
  }
412
475
  /** The global help. Exported so its Options block can be held against {@link ROOT_FLAGS}. */
@@ -432,6 +495,7 @@ ${chalk.green.bold("Schema")}
432
495
  ${chalk.blue.bold("schema generate")} Generate the Drizzle schema from backend/schema
433
496
  ${chalk.blue.bold("schema introspect")} Introspect database → defineTable modules in backend/schema
434
497
  ${chalk.blue.bold("schema stale")} Report generated schema files the tables have moved past
498
+ ${chalk.blue.bold("schema show")} ${chalk.gray("[table]")} The tables and their columns ${chalk.gray("(--remote: as a running server serves them)")}
435
499
  ${chalk.blue.bold("schema")} ${chalk.gray("--help")} Show schema command help
436
500
 
437
501
  ${chalk.green.bold("Database")}
@@ -451,8 +515,19 @@ ${chalk.green.bold("Generate")}
451
515
  ${chalk.blue.bold("generate view")} ${chalk.gray("<slug>")} Scaffold a custom admin screen ${chalk.gray("(--collection: a record tab)")}
452
516
  ${chalk.blue.bold("generate-sdk")} Generate a typed TypeScript SDK from the tables
453
517
 
518
+ ${chalk.green.bold("A running app")} ${chalk.gray("(rebase dev, --url <server>, or --project <slug> on Rebase Cloud)")}
519
+ ${chalk.blue.bold("api")} ${chalk.gray("[METHOD] <path>")} Send any request to the app's API with the project's credential
520
+ ${chalk.blue.bold("data")} ${chalk.gray("<action>")} Rows: query, get, count, insert, update, delete, import, watch
521
+ ${chalk.blue.bold("users")} ${chalk.gray("<action>")} Accounts: list, create, roles, reset-password, guests
522
+ ${chalk.blue.bold("cron")} ${chalk.gray("<action>")} Scheduled jobs: list, logs, run now, enable, disable
523
+ ${chalk.blue.bold("logs")} The server's log, once or followed ${chalk.gray("(-f)")}
524
+ ${chalk.blue.bold("functions")} ${chalk.gray("<action>")} Your backend/functions routes: list, invoke
525
+ ${chalk.blue.bold("rls simulate")} What another role, user or key would see
526
+
454
527
  ${chalk.green.bold("Auth")}
455
528
  ${chalk.blue.bold("auth reset-password")} Reset a user's password
529
+ ${chalk.blue.bold("auth login")} Sign in to a running app as a person ${chalk.gray("(for rls simulate, --session)")}
530
+ ${chalk.blue.bold("auth emails")} The development mailbox: captured sign-in and reset links
456
531
  ${chalk.blue.bold("auth")} ${chalk.gray("--help")} Show auth command help
457
532
 
458
533
  ${chalk.green.bold("Diagnostics")}
@@ -471,6 +546,7 @@ ${chalk.green.bold("API Keys")}
471
546
  ${chalk.blue.bold("api-keys list")} List the service API keys: kind, scopes, roles
472
547
  ${chalk.blue.bold("api-keys get")} ${chalk.gray("<id>")} Show one key
473
548
  ${chalk.blue.bold("api-keys create")} Create a service key holding the scopes you name
549
+ ${chalk.blue.bold("api-keys update")} ${chalk.gray("<id>")} Change a key's scopes, roles, limit or expiry
474
550
  ${chalk.blue.bold("api-keys revoke")} Revoke an API key
475
551
  ${chalk.blue.bold("api-keys scopes")} List the scopes a key can hold
476
552
  ${chalk.blue.bold("api-keys")} ${chalk.gray("--help")} Show API key command help
@@ -514,6 +590,6 @@ function telemetryNotice() {
514
590
  return chalk.gray(`Usage sharing: ${sharing ? "on" : "off"} — ${chalk.cyan("rebase telemetry")} to inspect or change\n`);
515
591
  }
516
592
  //#endregion
517
- export { BUNDLED_UI_CONFIG, CURRENT_RUNTIME_RANGE, DEFAULT_BUNDLE_DIR, DEFAULT_CRONS_DIR, DEFAULT_FUNCTIONS_DIR, DEFAULT_SCHEMA_FILE, DEFAULT_TABLES_DIR, GENERATED_DIR, HOOKS_FILE, LEGACY_CONFIG_DIR, ManifestError, RESOURCES_FILE, STORAGE_FILE, TABLES_INDEX_FILES, UNVENDORED_COST, VENDOR_SIZE_MAX_BYTES, VENDOR_SIZE_WARN_BYTES, VENDOR_TARGET_CPU, VENDOR_TARGET_OS, assessManagedCompatibility, buildBundle, buildStaticBundle, buildableApps, bundleUiConfig, bundledNpmrc, cmsMountOf, collectDeclaredDependencies, commentSpans, compareMountOrder, composeBundleManifest, describeDepConflicts, detectDeclaredDepConflicts, detectFrameworkDepDrift, detectNativeDependencies, detectStorageAuthorize, entry, findBackendApp, findTablesIndex, findUnusedServerEntry, foldStaticIntoBundle, formatAppAddress, loadManifest, manifestExists, manifestPath, normalizeEsmSpecifiers, resolveBackendPaths, selectDeployApp, staticAppAddress, synthesizeManifest, unvendoredReason, validateManifest, vendorDependencies, writeManifest };
593
+ export { BUNDLED_UI_CONFIG, CURRENT_RUNTIME_RANGE, DEFAULT_BUNDLE_DIR, DEFAULT_CRONS_DIR, DEFAULT_FUNCTIONS_DIR, DEFAULT_SCHEMA_FILE, DEFAULT_TABLES_DIR, GENERATED_DIR, HOOKS_FILE, LEGACY_CONFIG_DIR, ManifestError, RESOURCES_FILE, STORAGE_FILE, TABLES_INDEX_FILES, UNVENDORED_COST, VENDOR_SIZE_MAX_BYTES, VENDOR_SIZE_WARN_BYTES, VENDOR_TARGET_CPU, VENDOR_TARGET_OS, assessManagedCompatibility, buildBundle, buildStaticBundle, buildableApps, bundleUiConfig, bundledNpmrc, cmsMountOf, collectDeclaredDependencies, commentSpans, compareMountOrder, composeBundleManifest, describeDepConflicts, detectDeclaredDepConflicts, detectFrameworkDepDrift, detectNativeDependencies, detectStorageAuthorize, entry, findBackendApp, findIgnoredConfigStorageAuthorize, findTablesIndex, findUnusedServerEntry, foldStaticIntoBundle, formatAppAddress, loadManifest, manifestExists, manifestPath, normalizeEsmSpecifiers, resolveBackendPaths, selectDeployApp, staticAppAddress, synthesizeManifest, unvendoredReason, validateManifest, vendorDependencies, writeManifest };
518
594
 
519
595
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport arg from \"arg\";\nimport { errorClass, isEnabled, recordEvent } from \"./telemetry\";\nimport { failAsJson, requireProjectRoot, wantsJsonOutput } from \"./utils/project\";\nimport { parseCommandArgs, UsageError } from \"./utils/args\";\nimport { refuseRemovedCollectionsFlag } from \"./utils/path-flags\";\nimport { unknownCommand } from \"./utils/unknown-command\";\nimport { cliVersion } from \"./utils/version\";\nimport path from \"path\";\n\n/**\n * Silence dotenv's own banner, for this process and everything it spawns.\n *\n * dotenv 17 prints `injected env (13) from .env // tip: ◈ encrypted .env\n * [www.dotenvx.com]` on every `config()` — a third-party advertisement that\n * appeared in `rebase dev`, `rebase build` and, because `rebase start` loads\n * the same way, in production server logs. `DOTENV_CONFIG_QUIET` is dotenv's\n * documented switch (`lib/main.js` reads it before `options.quiet`), and\n * setting it in `process.env` also reaches the backend, Vite and Atlas child\n * processes, which inherit it. Errors are unaffected — `quiet` gates the\n * success banner only.\n *\n * Not forced: an explicit `DOTENV_CONFIG_QUIET=false` still turns it back on.\n */\nfunction silenceDotenvBanner(): void {\n if (process.env.DOTENV_CONFIG_QUIET === undefined) {\n process.env.DOTENV_CONFIG_QUIET = \"true\";\n }\n}\n\n/**\n * The flags that mean the same thing wherever they appear.\n *\n * `--debug` is in here even though this file does not act on it: it is\n * implemented one level up, in `bin/rebase.js`, which prints the stack of a\n * failed command instead of the one-line message. That is exactly why it went\n * missing from the help for as long as it did — the flag lived in the\n * launcher, the Options block lived here, and neither knew about the other.\n * Declaring it here puts both under one spec, which `cli.test.ts` holds\n * against the printed help.\n *\n * Exported for that test.\n */\nexport const ROOT_FLAGS = {\n \"--version\": Boolean,\n \"--help\": Boolean,\n \"--debug\": Boolean,\n \"-v\": \"--version\",\n \"-h\": \"--help\"\n} as const;\n\n/**\n * Every command the dispatch below answers and the help lists. Declared as a\n * literal under this name: `help-coverage.test.ts`, `printed-commands.test.ts`\n * and the docs verifier read it out of this file's source.\n */\nconst namespacedCommands = [\"init\", \"schema\", \"db\", \"console\", \"dev\", \"build\", \"start\", \"auth\", \"doctor\", \"verify\", \"skills\", \"api-keys\", \"storage\", \"cloud\", \"apps\", \"eject\", \"generate\", \"generate-sdk\", \"telemetry\", \"resources\", \"status\", \"upgrade\", \"migrate\", \"normalize-imports\"];\n\n/** The words a command group dispatches, and the other spellings it accepts for them. */\ninterface CommandVocabulary {\n subcommands: readonly string[];\n aliases: Readonly<Record<string, string>>;\n}\n\nconst NO_VOCABULARY: CommandVocabulary = { subcommands: [], aliases: {} };\n\n/**\n * The subcommands each command group dispatches, from the lists those groups\n * dispatch on. A command absent from here takes no subcommand.\n *\n * Read from the group's own module, which is loaded here rather than at\n * startup: every command module is imported when its command runs (see\n * {@link dispatch}), and this is only ever asked about the command being run,\n * whose module the dispatch is about to load anyway.\n */\nasync function commandVocabulary(command: string): Promise<CommandVocabulary> {\n switch (command) {\n case \"schema\": return { subcommands: (await import(\"./commands/schema\")).SCHEMA_SUBCOMMANDS, aliases: {} };\n case \"db\": return { subcommands: (await import(\"./commands/db\")).DB_SUBCOMMANDS, aliases: {} };\n case \"auth\": return { subcommands: (await import(\"./commands/auth\")).AUTH_SUBCOMMANDS, aliases: {} };\n case \"skills\": return { subcommands: (await import(\"./commands/skills\")).SKILLS_SUBCOMMANDS, aliases: {} };\n case \"api-keys\": return { subcommands: (await import(\"./commands/api-keys\")).API_KEYS_SUBCOMMANDS, aliases: {} };\n case \"storage\": return { subcommands: (await import(\"./commands/storage\")).STORAGE_SUBCOMMANDS, aliases: {} };\n case \"apps\": return { subcommands: (await import(\"./commands/apps\")).APPS_SUBCOMMANDS, aliases: {} };\n case \"telemetry\": return { subcommands: (await import(\"./commands/telemetry\")).TELEMETRY_SUBCOMMANDS, aliases: {} };\n case \"generate\": return { subcommands: (await import(\"./commands/generate-view\")).GENERATE_SUBCOMMANDS, aliases: {} };\n case \"migrate\": return { subcommands: (await import(\"./commands/migrate\")).MIGRATE_SUBCOMMANDS, aliases: {} };\n case \"cloud\": {\n const cloud = await import(\"./commands/cloud\");\n return { subcommands: cloud.CLOUD_GROUP_NAMES, aliases: cloud.GROUP_ALIASES };\n }\n default: return NO_VOCABULARY;\n }\n}\n\n/**\n * The subcommand in the words after a command, read against the subcommands the\n * group dispatches.\n *\n * The first word that is not a flag is not always the subcommand: after a flag\n * that takes a value it is that value. `rebase db --schema-dir ./s push` was\n * refused as an unknown db command `./s`, `rebase api-keys --name ci create` as\n * one called `ci`, and `rebase skills --agent claude install` as `claude` —\n * lines every one of those commands parses happily once it is reached.\n *\n * Which flags take a value is not known at this level, so the vocabulary decides\n * instead: a word the group dispatches is the subcommand; a word straight after\n * a flag (and not glued to it with `=`) may be that flag's value and is passed\n * over. When no word is a known subcommand, the first word is returned as\n * before, so a typo — `rebase db psuh`, `rebase db --dry-run psuh` — still\n * reaches the group and is refused by name. A command with no vocabulary keeps\n * the first word.\n *\n * Exported for its tests.\n */\nexport function resolveSubcommand(after: readonly string[], known: readonly string[]): string | undefined {\n const words = after.filter(token => !token.startsWith(\"-\"));\n if (known.length === 0) return words[0];\n for (let i = 0; i < after.length; i++) {\n const token = after[i];\n if (token.startsWith(\"-\")) continue;\n if (known.includes(token)) return token;\n const previous = after[i - 1];\n const mayBeAValue = previous !== undefined && previous.startsWith(\"-\") && !previous.includes(\"=\");\n if (!mayBeAValue) return token;\n }\n return words[0];\n}\n\n/**\n * The command and subcommand words as `cli.error` may send them: each one is a\n * word this CLI dispatches, `\"none\"` when nothing was typed, or `\"other\"`.\n *\n * The words come from what was typed, and what is typed after a command is\n * only sometimes a subcommand. `rebase init acme-payroll-internal`, `rebase\n * cloud --project acme-prod deploy` and `rebase db psuh` put a project name, a\n * slug and a typo in the subcommand's position — the consent screen promises\n * \"never project names\", and `sanitize` cannot tell one of those from a\n * subcommand because neither has a separator in it. So the words are held\n * against the vocabulary here, where it is known, and nothing else survives.\n *\n * Exported for `cli.test.ts`.\n */\nexport async function telemetryCommandWords(\n command: string | undefined,\n subcommand: string | undefined\n): Promise<{ command: string; subcommand: string }> {\n if (!command) return { command: \"none\", subcommand: \"none\" };\n const dispatched = namespacedCommands.includes(command) || command === \"__dev-db-daemon\";\n if (!dispatched) return { command: \"other\", subcommand: subcommand ? \"other\" : \"none\" };\n\n if (!subcommand) return { command, subcommand: \"none\" };\n if (subcommand === \"--help\") return { command, subcommand };\n const { subcommands, aliases } = await commandVocabulary(command);\n const canonical = aliases[subcommand] ?? subcommand;\n return { command, subcommand: subcommands.includes(canonical) ? canonical : \"other\" };\n}\n\nexport async function entry(args: string[]) {\n silenceDotenvBanner();\n\n const parsedArgs = arg(\n { ...ROOT_FLAGS },\n {\n argv: args.slice(2),\n permissive: true\n }\n );\n\n if (parsedArgs[\"--version\"]) {\n console.log(cliVersion());\n return;\n }\n\n // `permissive: true` is load-bearing here — each command parses its own\n // flags, so this parser must pass anything it does not recognise through\n // rather than reject it. The cost is that `arg` puts those flags into `_`,\n // mixed in with the positionals: for `rebase cloud --json storage create`,\n // `_` is [\"cloud\", \"--json\", \"storage\", \"create\"] and the subcommand read as\n // \"--json\". Skip the flags when naming the command and its subcommand.\n //\n // A flag that takes a value leaves the value behind as a bare token, and\n // which flags take values is a fact only the individual command knows — for\n // `db` and `schema`, only the database driver's own CLI. So the subcommand\n // is named against the group's vocabulary instead: see `resolveSubcommand`.\n // `cloud` resolves its own group and action against the family's flag\n // specs — `positionals()` in commands/cloud/index.ts.\n const commandAt = parsedArgs._.findIndex(a => !a.startsWith(\"-\"));\n const command = commandAt === -1 ? undefined : parsedArgs._[commandAt];\n const subcommand = command === undefined\n ? undefined\n : resolveSubcommand(parsedArgs._.slice(commandAt + 1), (await commandVocabulary(command)).subcommands);\n\n // Show global help only when no command given, or --help with no recognized command\n if (!command || (parsedArgs[\"--help\"] && !namespacedCommands.includes(command))) {\n printHelp();\n return;\n }\n\n // For a namespaced command, `--help` becomes the subcommand *only when the\n // user did not name one*. `rebase db --help` wants the db help; `rebase\n // cloud env --help` wants env's, and overwriting \"env\" with \"--help\" was\n // what made every `rebase cloud <group> --help` print the same index page —\n // the group never reached the dispatcher. Seven cloud modules declare their\n // own `\"--help\": Boolean` and none of it could run, so ~44 flags had no way\n // to be listed.\n //\n // A group still gets its `--help` in `rawArgs` either way, so a handler that\n // parses its own flags sees the request whichever branch this takes.\n const effectiveSubcommand = parsedArgs[\"--help\"] && !subcommand ? \"--help\" : subcommand;\n\n try {\n await dispatch(command, effectiveSubcommand, args, parsedArgs, namespacedCommands);\n } catch (error) {\n // What failed, never why. `cli.error` records the command that threw and\n // a classification of the error — never its message, and never anything\n // derived from one. The consent screen promises \"no project names,\n // paths, schemas, URLs or error messages\", and a failure is exactly\n // where those leak: a message is usually a path, a connection string or\n // a column name. Which command fails, and how often, is the signal\n // worth having and costs none of that.\n //\n // The classification is `errorClass`, not `error.constructor.name`.\n // Both are safe, but the constructor name is almost always the useless\n // half of the answer: Node reports a refused connection, a missing file\n // and a permission denial all as plain `Error` carrying a `code`, so\n // every ECONNREFUSED, ENOENT and EACCES arrived here as the word\n // \"Error\" and the one question this event exists to answer — what is\n // actually going wrong out there — had no answer in the data.\n // `errorClass` prefers the `code` and falls back to the name, and it\n // is already the classifier the payload contract is written around.\n //\n // `recordEvent` is fire-and-forget and swallows its own failures, but it\n // is awaited so a short-lived CLI does not exit before the request is\n // made. The error is re-thrown untouched — `bin/rebase.js` owns how a\n // failure is printed and what the exit code is.\n //\n // The command words go through `telemetryCommandWords`, never raw: a\n // word typed after a command is as often a project name or a typo as a\n // subcommand, and neither has a separator for `sanitize` to catch.\n await recordEvent(\"cli.error\", {\n ...(await telemetryCommandWords(command, effectiveSubcommand)),\n error_type: errorClass(error),\n usage: Boolean(error && typeof error === \"object\" && (error as { isUsageError?: unknown }).isUsageError)\n }, { projectRoot: process.cwd() });\n // The one failure printed here rather than by `bin/rebase.js`: a caller\n // that asked for `--json` is promised one JSON value on stdout on every\n // exit, and a mistyped flag (`rebase status --json --bogus`) left stdout\n // empty — an agent parsing it unconditionally got an empty-input error\n // instead of the reason.\n if (error instanceof UsageError && wantsJsonOutput(args)) {\n failAsJson(error.message, \"usage\", `Run \\`rebase ${command} --help\\` for the flags it takes.`);\n }\n throw error;\n }\n}\n\n/**\n * The dispatch, lifted out of {@link entry} so the whole of it sits inside one\n * `try`. Inlining the switch there would have put the `catch` around the flag\n * parsing too, which throws its own usage errors before a command is even named.\n *\n * Each command's module is imported here, when its command runs. Imported at\n * the top of this file, every invocation (`rebase --version` and `--help`\n * included, and the CLI `rebase dev` re-runs for itself) loaded all of them:\n * inquirer, execa, the SDK client, the code generator and the server\n * packages, 231 modules and 125–144 ms before the first line of output.\n */\nasync function dispatch(\n command: string | undefined,\n effectiveSubcommand: string | undefined,\n args: string[],\n parsedArgs: Record<string, unknown>,\n namespacedCommands: string[]\n): Promise<void> {\n switch (command) {\n // Hidden: the managed development database's own process, spawned by\n // `ensureManagedDatabase` re-invoking this CLI. Not in\n // `namespacedCommands` and not in the help, because it is never typed\n // by a person — it exists so the daemon resolves the same way from\n // `src` under tsx and from a bundled `dist`.\n case \"__dev-db-daemon\": {\n const { parseDaemonArgs, runDaemon } = await import(\"./dev-db/daemon-entry\");\n await runDaemon(parseDaemonArgs(args));\n // Deliberately no `break`-and-return: the daemon owns this process\n // from here and exits through its own signal handlers.\n return;\n }\n\n case \"init\": {\n const { createRebaseApp } = await import(\"./commands/init\");\n await createRebaseApp(args);\n break;\n }\n\n case \"generate-sdk\": {\n // Strict, and parsed from the whole line rather than `slice(3)`.\n // Permissive parsing turned a typo into silence: `rebase\n // generate-sdk --ouput ./sdk` wrote the SDK to the default path and\n // said nothing, so the next build imported a stale one. And the\n // fixed slice meant `rebase --debug generate-sdk -o ./sdk` read\n // `generate-sdk` as the first token of the flag line, dropping the\n // flags entirely. `parseCommandArgs` fixes both: it consumes flags\n // wherever they appear and rejects the ones nobody declared.\n refuseRemovedCollectionsFlag(args.slice(2), \"generate-sdk\");\n const { flags: sdkArgs, help: sdkHelp } = parseCommandArgs({\n spec: {\n // `--schema-dir`, as every command that reads the tables spells it.\n \"--schema-dir\": String,\n \"--output\": String,\n // The alias `build`, `cloud env pull` and `db backup` carry.\n // Two names for one concept across one CLI is a thing you\n // have to remember rather than know.\n \"--out\": \"--output\",\n \"--from\": String,\n \"--token\": String,\n \"--register\": Boolean,\n \"-o\": \"--output\"\n },\n rawArgs: args,\n commandWords: 1,\n command: \"generate-sdk\",\n maxPositionals: 0\n });\n // Defaults hang off the project root, not the cwd. A default schema\n // directory relative to wherever you happen to be standing meant\n // `rebase generate-sdk` worked from the repository root and threw\n // \"directory not found\" one directory down — from\n // `backend/`, from `frontend/`, from anywhere a developer actually\n // sits — while `rebase db push` and `rebase dev` worked from all of\n // them. An explicitly passed path still resolves against the cwd,\n // which is where the person typing it means it.\n const sdkRoot = sdkHelp ? process.cwd() : requireProjectRoot();\n const { generateSdkCommand } = await import(\"./commands/generate_sdk\");\n await generateSdkCommand({\n schemaDir: sdkArgs[\"--schema-dir\"]\n || (sdkHelp ? sdkRoot : (await import(\"./utils/schema-dir\")).resolveSchemaDir(sdkRoot)),\n output: sdkArgs[\"--output\"] || path.join(sdkRoot, \"generated/sdk\"),\n from: sdkArgs[\"--from\"],\n token: sdkArgs[\"--token\"],\n register: sdkArgs[\"--register\"],\n projectRoot: sdkHelp ? undefined : sdkRoot,\n help: sdkHelp,\n cwd: process.cwd()\n });\n break;\n }\n\n case \"schema\": {\n const { schemaCommand } = await import(\"./commands/schema\");\n await schemaCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"db\": {\n const { dbCommand } = await import(\"./commands/db\");\n await dbCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"console\": {\n const { consoleCommand } = await import(\"./commands/console\");\n await consoleCommand(args);\n break;\n }\n\n case \"dev\": {\n const { devCommand } = await import(\"./commands/dev\");\n await devCommand(args);\n break;\n }\n\n case \"normalize-imports\": {\n const { normalizeImportsCommand } = await import(\"./commands/normalize-imports\");\n await normalizeImportsCommand(args);\n break;\n }\n case \"build\": {\n const { buildCommand } = await import(\"./commands/build\");\n await buildCommand(args);\n break;\n }\n\n case \"start\": {\n const { startCommand } = await import(\"./commands/start\");\n await startCommand(args);\n break;\n }\n\n case \"upgrade\": {\n const { upgradeCommand } = await import(\"./commands/upgrade\");\n await upgradeCommand(args);\n break;\n }\n\n case \"migrate\": {\n const { migrateCommand } = await import(\"./commands/migrate\");\n await migrateCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"apps\": {\n const { appsCommand } = await import(\"./commands/apps\");\n await appsCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"generate\": {\n const { generateCommand } = await import(\"./commands/generate-view\");\n await generateCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"eject\": {\n const { ejectCommand } = await import(\"./commands/eject\");\n await ejectCommand(args);\n break;\n }\n\n case \"auth\": {\n const { authCommand } = await import(\"./commands/auth\");\n await authCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"status\": {\n const { statusCommand } = await import(\"./commands/status\");\n await statusCommand(args);\n break;\n }\n case \"resources\": {\n const { resourcesCommand } = await import(\"./commands/resources\");\n await resourcesCommand(args);\n break;\n }\n case \"doctor\": {\n const { doctorCommand } = await import(\"./commands/doctor\");\n await doctorCommand(args);\n break;\n }\n\n case \"verify\": {\n const { verifyCommand } = await import(\"./commands/verify\");\n await verifyCommand(args);\n break;\n }\n\n case \"skills\": {\n const { skillsCommand } = await import(\"./commands/skills\");\n await skillsCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"api-keys\": {\n const { apiKeysCommand } = await import(\"./commands/api-keys\");\n await apiKeysCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"storage\": {\n const { storageCommand } = await import(\"./commands/storage\");\n await storageCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"cloud\": {\n const { cloudCommand } = await import(\"./commands/cloud\");\n await cloudCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"telemetry\": {\n const { telemetryCommand } = await import(\"./commands/telemetry\");\n await telemetryCommand(args);\n break;\n }\n\n default:\n // One line, with the correction, and no screen of help after it: the\n // sentence that says what happened must not scroll off the top of a\n // CI log. `namespacedCommands` is the dispatch itself, so the\n // suggestion can never name a command that is not there.\n //\n // A mistyped command must not look like success to a shell or CI.\n //\n // And a word that is a whole cloud command — `rebase deploy` — is\n // named as one: `cloud deploy`.\n unknownCommand(command, namespacedCommands, \"\", { cloud: (await import(\"./commands/cloud\")).CLOUD_GROUP_NAMES });\n }\n}\n\n/** The global help. Exported so its Options block can be held against {@link ROOT_FLAGS}. */\nexport function printHelp() {\n console.log(`\n${chalk.bold(\"Rebase CLI\")} — Developer tools for Rebase projects\n\n${chalk.green.bold(\"Usage\")}\n rebase ${chalk.blue(\"<command>\")} [options]\n\n${chalk.green.bold(\"Commands\")}\n ${chalk.blue.bold(\"init\")} Create a new Rebase project\n ${chalk.blue.bold(\"dev\")} Start the development server\n ${chalk.blue.bold(\"build\")} Build the apps declared in rebase.json into a bundle\n ${chalk.blue.bold(\"normalize-imports\")} Complete compiled output's relative imports for Node ESM\n ${chalk.blue.bold(\"start\")} Run the built bundle, as a deployment does ${chalk.gray(\"(in the NODE_ENV you set)\")}\n ${chalk.blue.bold(\"upgrade\")} Move every @rebasepro package to one release, then install\n ${chalk.blue.bold(\"migrate collections-to-tables\")} config/collections → backend/schema, SQL-checked\n ${chalk.blue.bold(\"migrate sdk-calls\")} Rewrite your own code for the table renames (data.table, rule keys)\n ${chalk.blue.bold(\"apps list\")} Show the apps this repository declares\n\n${chalk.green.bold(\"Schema\")}\n ${chalk.blue.bold(\"schema generate\")} Generate the Drizzle schema from backend/schema\n ${chalk.blue.bold(\"schema introspect\")} Introspect database → defineTable modules in backend/schema\n ${chalk.blue.bold(\"schema stale\")} Report generated schema files the tables have moved past\n ${chalk.blue.bold(\"schema\")} ${chalk.gray(\"--help\")} Show schema command help\n\n${chalk.green.bold(\"Database\")}\n ${chalk.blue.bold(\"db push\")} Apply schema directly to database ${chalk.gray(\"(dev)\")}\n ${chalk.blue.bold(\"db generate\")} Generate SQL migration files\n ${chalk.blue.bold(\"db migrate\")} Run pending migrations\n ${chalk.blue.bold(\"db pull\")} Copy another database into local development\n ${chalk.blue.bold(\"db branch\")} Create, list, switch and delete database branches\n ${chalk.blue.bold(\"db stop\")} Stop the managed development database ${chalk.gray(\"(data is kept)\")}\n ${chalk.blue.bold(\"db reset\")} Delete the managed development database and start over\n ${chalk.blue.bold(\"db\")} ${chalk.gray(\"--help\")} Backup, restore, and every flag\n\n${chalk.green.bold(\"Explore\")}\n ${chalk.blue.bold(\"console\")} A REPL with the project's data in scope ${chalk.gray(\"(-e <code> runs one snippet)\")}\n\n${chalk.green.bold(\"Generate\")}\n ${chalk.blue.bold(\"generate view\")} ${chalk.gray(\"<slug>\")} Scaffold a custom admin screen ${chalk.gray(\"(--collection: a record tab)\")}\n ${chalk.blue.bold(\"generate-sdk\")} Generate a typed TypeScript SDK from the tables\n\n${chalk.green.bold(\"Auth\")}\n ${chalk.blue.bold(\"auth reset-password\")} Reset a user's password\n ${chalk.blue.bold(\"auth\")} ${chalk.gray(\"--help\")} Show auth command help\n\n${chalk.green.bold(\"Diagnostics\")}\n ${chalk.blue.bold(\"status\")} Show every resource and whether its variables are set\n ${chalk.blue.bold(\"doctor\")} Detect schema drift between tables, generated schema, and DB\n ${chalk.blue.bold(\"verify\")} Check tables, RLS coverage and migrations ${chalk.gray(\"(CI + agent hooks)\")}\n ${chalk.blue.bold(\"resources\")} List the databases, buckets and topics this project declares\n\n${chalk.green.bold(\"Take ownership\")}\n ${chalk.blue.bold(\"eject\")} Own the server process and the image ${chalk.gray(\"(one-way)\")}\n\n${chalk.green.bold(\"AI Agent Skills\")}\n ${chalk.blue.bold(\"skills install\")} Install Rebase agent skills for your AI coding assistant\n\n${chalk.green.bold(\"API Keys\")}\n ${chalk.blue.bold(\"api-keys list\")} List the service API keys: kind, scopes, roles\n ${chalk.blue.bold(\"api-keys get\")} ${chalk.gray(\"<id>\")} Show one key\n ${chalk.blue.bold(\"api-keys create\")} Create a service key holding the scopes you name\n ${chalk.blue.bold(\"api-keys revoke\")} Revoke an API key\n ${chalk.blue.bold(\"api-keys scopes\")} List the scopes a key can hold\n ${chalk.blue.bold(\"api-keys\")} ${chalk.gray(\"--help\")} Show API key command help\n\n${chalk.green.bold(\"Stored files\")}\n ${chalk.blue.bold(\"storage orphans\")} List the stored files no row names ${chalk.gray(\"(--delete to delete)\")}\n ${chalk.blue.bold(\"storage move\")} Copy a folder of files to another storage source\n\n${chalk.green.bold(\"Usage sharing\")}\n ${chalk.blue.bold(\"telemetry\")} Anonymous usage sharing (opt-in, off by default)\n\n${chalk.green.bold(\"Rebase Cloud\")}\n ${chalk.blue.bold(\"cloud login\")} Sign in to the hosted control plane\n ${chalk.blue.bold(\"cloud link\")} Link this directory to a cloud project\n ${chalk.blue.bold(\"cloud deploy\")} Deploy the linked project + stream logs\n ${chalk.blue.bold(\"cloud tokens create\")} A token for CI and agents ${chalk.gray(\"(used as REBASE_TOKEN)\")}\n ${chalk.blue.bold(\"cloud\")} ${chalk.gray(\"--help\")} Show all cloud commands\n\n${chalk.green.bold(\"Options\")}\n ${chalk.blue(\"--version, -v\")} Show version number\n ${chalk.blue(\"--help, -h\")} Show this help message\n ${chalk.blue(\"--debug\")} Print the stack trace when a command fails ${chalk.gray(\"(or REBASE_DEBUG=1)\")}\n\n${chalk.gray(\"Documentation: https://rebase.pro/docs\")}\n${telemetryNotice()}`);\n}\n\n/**\n * One line about usage sharing, in the global help.\n *\n * Every other tool that collects anything prints a first-run notice. Ours asks\n * at the end of `rebase init` — but someone who installs the CLI and never runs\n * `init`, or who joins a project someone else scaffolded, would otherwise never\n * learn the subsystem exists. This is the cheapest place to close that: the\n * help is what an unfamiliar user reads first.\n *\n * It states the current setting rather than a generic sentence, so it is also\n * the fastest answer to \"is this thing on?\".\n */\nfunction telemetryNotice(): string {\n const sharing = isEnabled();\n return chalk.gray(\n `Usage sharing: ${sharing ? \"on\" : \"off\"} — ${chalk.cyan(\"rebase telemetry\")} to inspect or change\\n`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,sBAA4B;CACjC,IAAI,QAAQ,IAAI,wBAAwB,KAAA,GACpC,QAAQ,IAAI,sBAAsB;AAE1C;;;;;;;;;;;;;;AAeA,IAAa,aAAa;CACtB,aAAa;CACb,UAAU;CACV,WAAW;CACX,MAAM;CACN,MAAM;AACV;;;;;;AAOA,IAAM,qBAAqB;CAAC;CAAQ;CAAU;CAAM;CAAW;CAAO;CAAS;CAAS;CAAQ;CAAU;CAAU;CAAU;CAAY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E,wBACjF;AACJ"}
1
+ {"version":3,"file":"index.es.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport arg from \"arg\";\nimport { errorClass, isEnabled, recordEvent } from \"./telemetry\";\nimport { failAsJson, requireProjectRoot, wantsJsonOutput } from \"./utils/project\";\nimport { parseCommandArgs, UsageError } from \"./utils/args\";\nimport { refuseRemovedCollectionsFlag } from \"./utils/path-flags\";\nimport { unknownCommand } from \"./utils/unknown-command\";\nimport { cliVersion } from \"./utils/version\";\nimport path from \"path\";\n\n/**\n * Silence dotenv's own banner, for this process and everything it spawns.\n *\n * dotenv 17 prints `injected env (13) from .env // tip: ◈ encrypted .env\n * [www.dotenvx.com]` on every `config()` — a third-party advertisement that\n * appeared in `rebase dev`, `rebase build` and, because `rebase start` loads\n * the same way, in production server logs. `DOTENV_CONFIG_QUIET` is dotenv's\n * documented switch (`lib/main.js` reads it before `options.quiet`), and\n * setting it in `process.env` also reaches the backend, Vite and Atlas child\n * processes, which inherit it. Errors are unaffected — `quiet` gates the\n * success banner only.\n *\n * Not forced: an explicit `DOTENV_CONFIG_QUIET=false` still turns it back on.\n */\nfunction silenceDotenvBanner(): void {\n if (process.env.DOTENV_CONFIG_QUIET === undefined) {\n process.env.DOTENV_CONFIG_QUIET = \"true\";\n }\n}\n\n/**\n * The flags that mean the same thing wherever they appear.\n *\n * `--debug` is in here even though this file does not act on it: it is\n * implemented one level up, in `bin/rebase.js`, which prints the stack of a\n * failed command instead of the one-line message. That is exactly why it went\n * missing from the help for as long as it did — the flag lived in the\n * launcher, the Options block lived here, and neither knew about the other.\n * Declaring it here puts both under one spec, which `cli.test.ts` holds\n * against the printed help.\n *\n * Exported for that test.\n */\nexport const ROOT_FLAGS = {\n \"--version\": Boolean,\n \"--help\": Boolean,\n \"--debug\": Boolean,\n \"-v\": \"--version\",\n \"-h\": \"--help\"\n} as const;\n\n/**\n * Every command the dispatch below answers and the help lists. Declared as a\n * literal under this name: `help-coverage.test.ts`, `printed-commands.test.ts`\n * and the docs verifier read it out of this file's source.\n */\nconst namespacedCommands = [\"init\", \"schema\", \"db\", \"console\", \"dev\", \"build\", \"start\", \"auth\", \"doctor\", \"verify\", \"skills\", \"api-keys\", \"storage\", \"cloud\", \"apps\", \"eject\", \"generate\", \"generate-sdk\", \"telemetry\", \"resources\", \"status\", \"upgrade\", \"migrate\", \"normalize-imports\", \"api\", \"data\", \"users\", \"cron\", \"logs\", \"functions\", \"rls\"];\n\n/** The words a command group dispatches, and the other spellings it accepts for them. */\ninterface CommandVocabulary {\n subcommands: readonly string[];\n aliases: Readonly<Record<string, string>>;\n}\n\nconst NO_VOCABULARY: CommandVocabulary = { subcommands: [], aliases: {} };\n\n/**\n * The subcommands each command group dispatches, from the lists those groups\n * dispatch on. A command absent from here takes no subcommand.\n *\n * Read from the group's own module, which is loaded here rather than at\n * startup: every command module is imported when its command runs (see\n * {@link dispatch}), and this is only ever asked about the command being run,\n * whose module the dispatch is about to load anyway.\n */\nasync function commandVocabulary(command: string): Promise<CommandVocabulary> {\n switch (command) {\n case \"schema\": return { subcommands: (await import(\"./commands/schema\")).SCHEMA_SUBCOMMANDS, aliases: {} };\n case \"db\": return { subcommands: (await import(\"./commands/db\")).DB_SUBCOMMANDS, aliases: {} };\n case \"auth\": return { subcommands: (await import(\"./commands/auth\")).AUTH_SUBCOMMANDS, aliases: {} };\n case \"skills\": return { subcommands: (await import(\"./commands/skills\")).SKILLS_SUBCOMMANDS, aliases: {} };\n case \"api-keys\": return { subcommands: (await import(\"./commands/api-keys\")).API_KEYS_SUBCOMMANDS, aliases: {} };\n case \"storage\": return { subcommands: (await import(\"./commands/storage\")).STORAGE_SUBCOMMANDS, aliases: {} };\n case \"data\": return { subcommands: (await import(\"./commands/data\")).DATA_SUBCOMMANDS, aliases: {} };\n case \"users\": return { subcommands: (await import(\"./commands/users\")).USERS_SUBCOMMANDS, aliases: {} };\n case \"cron\": return { subcommands: (await import(\"./commands/cron\")).CRON_SUBCOMMANDS, aliases: {} };\n case \"functions\": return { subcommands: (await import(\"./commands/functions\")).FUNCTIONS_SUBCOMMANDS, aliases: {} };\n case \"rls\": return { subcommands: (await import(\"./commands/rls\")).RLS_SUBCOMMANDS, aliases: {} };\n case \"apps\": return { subcommands: (await import(\"./commands/apps\")).APPS_SUBCOMMANDS, aliases: {} };\n case \"telemetry\": return { subcommands: (await import(\"./commands/telemetry\")).TELEMETRY_SUBCOMMANDS, aliases: {} };\n case \"generate\": return { subcommands: (await import(\"./commands/generate-view\")).GENERATE_SUBCOMMANDS, aliases: {} };\n case \"migrate\": return { subcommands: (await import(\"./commands/migrate\")).MIGRATE_SUBCOMMANDS, aliases: {} };\n case \"cloud\": {\n const cloud = await import(\"./commands/cloud\");\n return { subcommands: cloud.CLOUD_GROUP_NAMES, aliases: cloud.GROUP_ALIASES };\n }\n default: return NO_VOCABULARY;\n }\n}\n\n/**\n * The subcommand in the words after a command, read against the subcommands the\n * group dispatches.\n *\n * The first word that is not a flag is not always the subcommand: after a flag\n * that takes a value it is that value. `rebase db --schema-dir ./s push` was\n * refused as an unknown db command `./s`, `rebase api-keys --name ci create` as\n * one called `ci`, and `rebase skills --agent claude install` as `claude` —\n * lines every one of those commands parses happily once it is reached.\n *\n * Which flags take a value is not known at this level, so the vocabulary decides\n * instead: a word the group dispatches is the subcommand; a word straight after\n * a flag (and not glued to it with `=`) may be that flag's value and is passed\n * over. When no word is a known subcommand, the first word is returned as\n * before, so a typo — `rebase db psuh`, `rebase db --dry-run psuh` — still\n * reaches the group and is refused by name. A command with no vocabulary keeps\n * the first word.\n *\n * Exported for its tests.\n */\nexport function resolveSubcommand(after: readonly string[], known: readonly string[]): string | undefined {\n const words = after.filter(token => !token.startsWith(\"-\"));\n if (known.length === 0) return words[0];\n for (let i = 0; i < after.length; i++) {\n const token = after[i];\n if (token.startsWith(\"-\")) continue;\n if (known.includes(token)) return token;\n const previous = after[i - 1];\n const mayBeAValue = previous !== undefined && previous.startsWith(\"-\") && !previous.includes(\"=\");\n if (!mayBeAValue) return token;\n }\n return words[0];\n}\n\n/**\n * The command and subcommand words as `cli.error` may send them: each one is a\n * word this CLI dispatches, `\"none\"` when nothing was typed, or `\"other\"`.\n *\n * The words come from what was typed, and what is typed after a command is\n * only sometimes a subcommand. `rebase init acme-payroll-internal`, `rebase\n * cloud --project acme-prod deploy` and `rebase db psuh` put a project name, a\n * slug and a typo in the subcommand's position — the consent screen promises\n * \"never project names\", and `sanitize` cannot tell one of those from a\n * subcommand because neither has a separator in it. So the words are held\n * against the vocabulary here, where it is known, and nothing else survives.\n *\n * Exported for `cli.test.ts`.\n */\nexport async function telemetryCommandWords(\n command: string | undefined,\n subcommand: string | undefined\n): Promise<{ command: string; subcommand: string }> {\n if (!command) return { command: \"none\", subcommand: \"none\" };\n const dispatched = namespacedCommands.includes(command) || command === \"__dev-db-daemon\";\n if (!dispatched) return { command: \"other\", subcommand: subcommand ? \"other\" : \"none\" };\n\n if (!subcommand) return { command, subcommand: \"none\" };\n if (subcommand === \"--help\") return { command, subcommand };\n const { subcommands, aliases } = await commandVocabulary(command);\n const canonical = aliases[subcommand] ?? subcommand;\n return { command, subcommand: subcommands.includes(canonical) ? canonical : \"other\" };\n}\n\nexport async function entry(args: string[]) {\n silenceDotenvBanner();\n\n const parsedArgs = arg(\n { ...ROOT_FLAGS },\n {\n argv: args.slice(2),\n permissive: true\n }\n );\n\n if (parsedArgs[\"--version\"]) {\n console.log(cliVersion());\n return;\n }\n\n // `permissive: true` is load-bearing here — each command parses its own\n // flags, so this parser must pass anything it does not recognise through\n // rather than reject it. The cost is that `arg` puts those flags into `_`,\n // mixed in with the positionals: for `rebase cloud --json storage create`,\n // `_` is [\"cloud\", \"--json\", \"storage\", \"create\"] and the subcommand read as\n // \"--json\". Skip the flags when naming the command and its subcommand.\n //\n // A flag that takes a value leaves the value behind as a bare token, and\n // which flags take values is a fact only the individual command knows — for\n // `db` and `schema`, only the database driver's own CLI. So the subcommand\n // is named against the group's vocabulary instead: see `resolveSubcommand`.\n // `cloud` resolves its own group and action against the family's flag\n // specs — `positionals()` in commands/cloud/index.ts.\n const commandAt = parsedArgs._.findIndex(a => !a.startsWith(\"-\"));\n const command = commandAt === -1 ? undefined : parsedArgs._[commandAt];\n const subcommand = command === undefined\n ? undefined\n : resolveSubcommand(parsedArgs._.slice(commandAt + 1), (await commandVocabulary(command)).subcommands);\n\n // Show global help only when no command given, or --help with no recognized command\n if (!command || (parsedArgs[\"--help\"] && !namespacedCommands.includes(command))) {\n printHelp();\n return;\n }\n\n // For a namespaced command, `--help` becomes the subcommand *only when the\n // user did not name one*. `rebase db --help` wants the db help; `rebase\n // cloud env --help` wants env's, and overwriting \"env\" with \"--help\" was\n // what made every `rebase cloud <group> --help` print the same index page —\n // the group never reached the dispatcher. Seven cloud modules declare their\n // own `\"--help\": Boolean` and none of it could run, so ~44 flags had no way\n // to be listed.\n //\n // A group still gets its `--help` in `rawArgs` either way, so a handler that\n // parses its own flags sees the request whichever branch this takes.\n const effectiveSubcommand = parsedArgs[\"--help\"] && !subcommand ? \"--help\" : subcommand;\n\n try {\n await dispatch(command, effectiveSubcommand, args, parsedArgs, namespacedCommands);\n } catch (error) {\n // What failed, never why. `cli.error` records the command that threw and\n // a classification of the error — never its message, and never anything\n // derived from one. The consent screen promises \"no project names,\n // paths, schemas, URLs or error messages\", and a failure is exactly\n // where those leak: a message is usually a path, a connection string or\n // a column name. Which command fails, and how often, is the signal\n // worth having and costs none of that.\n //\n // The classification is `errorClass`, not `error.constructor.name`.\n // Both are safe, but the constructor name is almost always the useless\n // half of the answer: Node reports a refused connection, a missing file\n // and a permission denial all as plain `Error` carrying a `code`, so\n // every ECONNREFUSED, ENOENT and EACCES arrived here as the word\n // \"Error\" and the one question this event exists to answer — what is\n // actually going wrong out there — had no answer in the data.\n // `errorClass` prefers the `code` and falls back to the name, and it\n // is already the classifier the payload contract is written around.\n //\n // `recordEvent` is fire-and-forget and swallows its own failures, but it\n // is awaited so a short-lived CLI does not exit before the request is\n // made. The error is re-thrown untouched — `bin/rebase.js` owns how a\n // failure is printed and what the exit code is.\n //\n // The command words go through `telemetryCommandWords`, never raw: a\n // word typed after a command is as often a project name or a typo as a\n // subcommand, and neither has a separator for `sanitize` to catch.\n await recordEvent(\"cli.error\", {\n ...(await telemetryCommandWords(command, effectiveSubcommand)),\n error_type: errorClass(error),\n usage: Boolean(error && typeof error === \"object\" && (error as { isUsageError?: unknown }).isUsageError)\n }, { projectRoot: process.cwd() });\n // The one failure printed here rather than by `bin/rebase.js`: a caller\n // that asked for `--json` is promised one JSON value on stdout on every\n // exit, and a mistyped flag (`rebase status --json --bogus`) left stdout\n // empty — an agent parsing it unconditionally got an empty-input error\n // instead of the reason.\n if (error instanceof UsageError && wantsJsonOutput(args)) {\n failAsJson(error.message, \"usage\", `Run \\`rebase ${command} --help\\` for the flags it takes.`);\n }\n throw error;\n }\n}\n\n/**\n * The dispatch, lifted out of {@link entry} so the whole of it sits inside one\n * `try`. Inlining the switch there would have put the `catch` around the flag\n * parsing too, which throws its own usage errors before a command is even named.\n *\n * Each command's module is imported here, when its command runs. Imported at\n * the top of this file, every invocation (`rebase --version` and `--help`\n * included, and the CLI `rebase dev` re-runs for itself) loaded all of them:\n * inquirer, execa, the SDK client, the code generator and the server\n * packages, 231 modules and 125–144 ms before the first line of output.\n */\nasync function dispatch(\n command: string | undefined,\n effectiveSubcommand: string | undefined,\n args: string[],\n parsedArgs: Record<string, unknown>,\n namespacedCommands: string[]\n): Promise<void> {\n switch (command) {\n // Hidden: the managed development database's own process, spawned by\n // `ensureManagedDatabase` re-invoking this CLI. Not in\n // `namespacedCommands` and not in the help, because it is never typed\n // by a person — it exists so the daemon resolves the same way from\n // `src` under tsx and from a bundled `dist`.\n case \"__dev-db-daemon\": {\n const { parseDaemonArgs, runDaemon } = await import(\"./dev-db/daemon-entry\");\n await runDaemon(parseDaemonArgs(args));\n // Deliberately no `break`-and-return: the daemon owns this process\n // from here and exits through its own signal handlers.\n return;\n }\n\n case \"init\": {\n const { createRebaseApp } = await import(\"./commands/init\");\n await createRebaseApp(args);\n break;\n }\n\n case \"generate-sdk\": {\n // Strict, and parsed from the whole line rather than `slice(3)`.\n // Permissive parsing turned a typo into silence: `rebase\n // generate-sdk --ouput ./sdk` wrote the SDK to the default path and\n // said nothing, so the next build imported a stale one. And the\n // fixed slice meant `rebase --debug generate-sdk -o ./sdk` read\n // `generate-sdk` as the first token of the flag line, dropping the\n // flags entirely. `parseCommandArgs` fixes both: it consumes flags\n // wherever they appear and rejects the ones nobody declared.\n refuseRemovedCollectionsFlag(args.slice(2), \"generate-sdk\");\n const { flags: sdkArgs, help: sdkHelp } = parseCommandArgs({\n spec: {\n // `--schema-dir`, as every command that reads the tables spells it.\n \"--schema-dir\": String,\n \"--output\": String,\n // The alias `build`, `cloud env pull` and `db backup` carry.\n // Two names for one concept across one CLI is a thing you\n // have to remember rather than know.\n \"--out\": \"--output\",\n \"--from\": String,\n \"--token\": String,\n \"--register\": Boolean,\n \"-o\": \"--output\"\n },\n rawArgs: args,\n commandWords: 1,\n command: \"generate-sdk\",\n maxPositionals: 0\n });\n // Defaults hang off the project root, not the cwd. A default schema\n // directory relative to wherever you happen to be standing meant\n // `rebase generate-sdk` worked from the repository root and threw\n // \"directory not found\" one directory down — from\n // `backend/`, from `frontend/`, from anywhere a developer actually\n // sits — while `rebase db push` and `rebase dev` worked from all of\n // them. An explicitly passed path still resolves against the cwd,\n // which is where the person typing it means it.\n const sdkRoot = sdkHelp ? process.cwd() : requireProjectRoot();\n const { generateSdkCommand } = await import(\"./commands/generate_sdk\");\n await generateSdkCommand({\n schemaDir: sdkArgs[\"--schema-dir\"]\n || (sdkHelp ? sdkRoot : (await import(\"./utils/schema-dir\")).resolveSchemaDir(sdkRoot)),\n output: sdkArgs[\"--output\"] || path.join(sdkRoot, \"generated/sdk\"),\n from: sdkArgs[\"--from\"],\n token: sdkArgs[\"--token\"],\n register: sdkArgs[\"--register\"],\n projectRoot: sdkHelp ? undefined : sdkRoot,\n help: sdkHelp,\n cwd: process.cwd()\n });\n break;\n }\n\n case \"schema\": {\n const { schemaCommand } = await import(\"./commands/schema\");\n await schemaCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"db\": {\n const { dbCommand } = await import(\"./commands/db\");\n await dbCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"console\": {\n const { consoleCommand } = await import(\"./commands/console\");\n await consoleCommand(args);\n break;\n }\n\n case \"dev\": {\n const { devCommand } = await import(\"./commands/dev\");\n await devCommand(args);\n break;\n }\n\n case \"normalize-imports\": {\n const { normalizeImportsCommand } = await import(\"./commands/normalize-imports\");\n await normalizeImportsCommand(args);\n break;\n }\n case \"build\": {\n const { buildCommand } = await import(\"./commands/build\");\n await buildCommand(args);\n break;\n }\n\n case \"start\": {\n const { startCommand } = await import(\"./commands/start\");\n await startCommand(args);\n break;\n }\n\n case \"upgrade\": {\n const { upgradeCommand } = await import(\"./commands/upgrade\");\n await upgradeCommand(args);\n break;\n }\n\n case \"migrate\": {\n const { migrateCommand } = await import(\"./commands/migrate\");\n await migrateCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"apps\": {\n const { appsCommand } = await import(\"./commands/apps\");\n await appsCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"generate\": {\n const { generateCommand } = await import(\"./commands/generate-view\");\n await generateCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"eject\": {\n const { ejectCommand } = await import(\"./commands/eject\");\n await ejectCommand(args);\n break;\n }\n\n case \"auth\": {\n const { authCommand } = await import(\"./commands/auth\");\n await authCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"status\": {\n const { statusCommand } = await import(\"./commands/status\");\n await statusCommand(args);\n break;\n }\n case \"resources\": {\n const { resourcesCommand } = await import(\"./commands/resources\");\n await resourcesCommand(args);\n break;\n }\n case \"doctor\": {\n const { doctorCommand } = await import(\"./commands/doctor\");\n await doctorCommand(args);\n break;\n }\n\n case \"verify\": {\n const { verifyCommand } = await import(\"./commands/verify\");\n await verifyCommand(args);\n break;\n }\n\n case \"skills\": {\n const { skillsCommand } = await import(\"./commands/skills\");\n await skillsCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"api-keys\": {\n const { apiKeysCommand } = await import(\"./commands/api-keys\");\n await apiKeysCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"storage\": {\n const { storageCommand } = await import(\"./commands/storage\");\n await storageCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"cloud\": {\n const { cloudCommand } = await import(\"./commands/cloud\");\n await cloudCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"telemetry\": {\n const { telemetryCommand } = await import(\"./commands/telemetry\");\n await telemetryCommand(args);\n break;\n }\n\n case \"api\": {\n const { apiCommand } = await import(\"./commands/api\");\n await apiCommand(args);\n break;\n }\n\n case \"data\": {\n const { dataCommand } = await import(\"./commands/data\");\n await dataCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"users\": {\n const { usersCommand } = await import(\"./commands/users\");\n await usersCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"cron\": {\n const { cronCommand } = await import(\"./commands/cron\");\n await cronCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"logs\": {\n const { logsCommand } = await import(\"./commands/logs\");\n await logsCommand(args);\n break;\n }\n\n case \"functions\": {\n const { functionsCommand } = await import(\"./commands/functions\");\n await functionsCommand(effectiveSubcommand, args);\n break;\n }\n\n case \"rls\": {\n const { rlsCommand } = await import(\"./commands/rls\");\n await rlsCommand(effectiveSubcommand, args);\n break;\n }\n\n default:\n // One line, with the correction, and no screen of help after it: the\n // sentence that says what happened must not scroll off the top of a\n // CI log. `namespacedCommands` is the dispatch itself, so the\n // suggestion can never name a command that is not there.\n //\n // A mistyped command must not look like success to a shell or CI.\n //\n // And a word that is a whole cloud command — `rebase deploy` — is\n // named as one: `cloud deploy`.\n unknownCommand(command, namespacedCommands, \"\", { cloud: (await import(\"./commands/cloud\")).CLOUD_GROUP_NAMES });\n }\n}\n\n/** The global help. Exported so its Options block can be held against {@link ROOT_FLAGS}. */\nexport function printHelp() {\n console.log(`\n${chalk.bold(\"Rebase CLI\")} — Developer tools for Rebase projects\n\n${chalk.green.bold(\"Usage\")}\n rebase ${chalk.blue(\"<command>\")} [options]\n\n${chalk.green.bold(\"Commands\")}\n ${chalk.blue.bold(\"init\")} Create a new Rebase project\n ${chalk.blue.bold(\"dev\")} Start the development server\n ${chalk.blue.bold(\"build\")} Build the apps declared in rebase.json into a bundle\n ${chalk.blue.bold(\"normalize-imports\")} Complete compiled output's relative imports for Node ESM\n ${chalk.blue.bold(\"start\")} Run the built bundle, as a deployment does ${chalk.gray(\"(in the NODE_ENV you set)\")}\n ${chalk.blue.bold(\"upgrade\")} Move every @rebasepro package to one release, then install\n ${chalk.blue.bold(\"migrate collections-to-tables\")} config/collections → backend/schema, SQL-checked\n ${chalk.blue.bold(\"migrate sdk-calls\")} Rewrite your own code for the table renames (data.table, rule keys)\n ${chalk.blue.bold(\"apps list\")} Show the apps this repository declares\n\n${chalk.green.bold(\"Schema\")}\n ${chalk.blue.bold(\"schema generate\")} Generate the Drizzle schema from backend/schema\n ${chalk.blue.bold(\"schema introspect\")} Introspect database → defineTable modules in backend/schema\n ${chalk.blue.bold(\"schema stale\")} Report generated schema files the tables have moved past\n ${chalk.blue.bold(\"schema show\")} ${chalk.gray(\"[table]\")} The tables and their columns ${chalk.gray(\"(--remote: as a running server serves them)\")}\n ${chalk.blue.bold(\"schema\")} ${chalk.gray(\"--help\")} Show schema command help\n\n${chalk.green.bold(\"Database\")}\n ${chalk.blue.bold(\"db push\")} Apply schema directly to database ${chalk.gray(\"(dev)\")}\n ${chalk.blue.bold(\"db generate\")} Generate SQL migration files\n ${chalk.blue.bold(\"db migrate\")} Run pending migrations\n ${chalk.blue.bold(\"db pull\")} Copy another database into local development\n ${chalk.blue.bold(\"db branch\")} Create, list, switch and delete database branches\n ${chalk.blue.bold(\"db stop\")} Stop the managed development database ${chalk.gray(\"(data is kept)\")}\n ${chalk.blue.bold(\"db reset\")} Delete the managed development database and start over\n ${chalk.blue.bold(\"db\")} ${chalk.gray(\"--help\")} Backup, restore, and every flag\n\n${chalk.green.bold(\"Explore\")}\n ${chalk.blue.bold(\"console\")} A REPL with the project's data in scope ${chalk.gray(\"(-e <code> runs one snippet)\")}\n\n${chalk.green.bold(\"Generate\")}\n ${chalk.blue.bold(\"generate view\")} ${chalk.gray(\"<slug>\")} Scaffold a custom admin screen ${chalk.gray(\"(--collection: a record tab)\")}\n ${chalk.blue.bold(\"generate-sdk\")} Generate a typed TypeScript SDK from the tables\n\n${chalk.green.bold(\"A running app\")} ${chalk.gray(\"(rebase dev, --url <server>, or --project <slug> on Rebase Cloud)\")}\n ${chalk.blue.bold(\"api\")} ${chalk.gray(\"[METHOD] <path>\")} Send any request to the app's API with the project's credential\n ${chalk.blue.bold(\"data\")} ${chalk.gray(\"<action>\")} Rows: query, get, count, insert, update, delete, import, watch\n ${chalk.blue.bold(\"users\")} ${chalk.gray(\"<action>\")} Accounts: list, create, roles, reset-password, guests\n ${chalk.blue.bold(\"cron\")} ${chalk.gray(\"<action>\")} Scheduled jobs: list, logs, run now, enable, disable\n ${chalk.blue.bold(\"logs\")} The server's log, once or followed ${chalk.gray(\"(-f)\")}\n ${chalk.blue.bold(\"functions\")} ${chalk.gray(\"<action>\")} Your backend/functions routes: list, invoke\n ${chalk.blue.bold(\"rls simulate\")} What another role, user or key would see\n\n${chalk.green.bold(\"Auth\")}\n ${chalk.blue.bold(\"auth reset-password\")} Reset a user's password\n ${chalk.blue.bold(\"auth login\")} Sign in to a running app as a person ${chalk.gray(\"(for rls simulate, --session)\")}\n ${chalk.blue.bold(\"auth emails\")} The development mailbox: captured sign-in and reset links\n ${chalk.blue.bold(\"auth\")} ${chalk.gray(\"--help\")} Show auth command help\n\n${chalk.green.bold(\"Diagnostics\")}\n ${chalk.blue.bold(\"status\")} Show every resource and whether its variables are set\n ${chalk.blue.bold(\"doctor\")} Detect schema drift between tables, generated schema, and DB\n ${chalk.blue.bold(\"verify\")} Check tables, RLS coverage and migrations ${chalk.gray(\"(CI + agent hooks)\")}\n ${chalk.blue.bold(\"resources\")} List the databases, buckets and topics this project declares\n\n${chalk.green.bold(\"Take ownership\")}\n ${chalk.blue.bold(\"eject\")} Own the server process and the image ${chalk.gray(\"(one-way)\")}\n\n${chalk.green.bold(\"AI Agent Skills\")}\n ${chalk.blue.bold(\"skills install\")} Install Rebase agent skills for your AI coding assistant\n\n${chalk.green.bold(\"API Keys\")}\n ${chalk.blue.bold(\"api-keys list\")} List the service API keys: kind, scopes, roles\n ${chalk.blue.bold(\"api-keys get\")} ${chalk.gray(\"<id>\")} Show one key\n ${chalk.blue.bold(\"api-keys create\")} Create a service key holding the scopes you name\n ${chalk.blue.bold(\"api-keys update\")} ${chalk.gray(\"<id>\")} Change a key's scopes, roles, limit or expiry\n ${chalk.blue.bold(\"api-keys revoke\")} Revoke an API key\n ${chalk.blue.bold(\"api-keys scopes\")} List the scopes a key can hold\n ${chalk.blue.bold(\"api-keys\")} ${chalk.gray(\"--help\")} Show API key command help\n\n${chalk.green.bold(\"Stored files\")}\n ${chalk.blue.bold(\"storage orphans\")} List the stored files no row names ${chalk.gray(\"(--delete to delete)\")}\n ${chalk.blue.bold(\"storage move\")} Copy a folder of files to another storage source\n\n${chalk.green.bold(\"Usage sharing\")}\n ${chalk.blue.bold(\"telemetry\")} Anonymous usage sharing (opt-in, off by default)\n\n${chalk.green.bold(\"Rebase Cloud\")}\n ${chalk.blue.bold(\"cloud login\")} Sign in to the hosted control plane\n ${chalk.blue.bold(\"cloud link\")} Link this directory to a cloud project\n ${chalk.blue.bold(\"cloud deploy\")} Deploy the linked project + stream logs\n ${chalk.blue.bold(\"cloud tokens create\")} A token for CI and agents ${chalk.gray(\"(used as REBASE_TOKEN)\")}\n ${chalk.blue.bold(\"cloud\")} ${chalk.gray(\"--help\")} Show all cloud commands\n\n${chalk.green.bold(\"Options\")}\n ${chalk.blue(\"--version, -v\")} Show version number\n ${chalk.blue(\"--help, -h\")} Show this help message\n ${chalk.blue(\"--debug\")} Print the stack trace when a command fails ${chalk.gray(\"(or REBASE_DEBUG=1)\")}\n\n${chalk.gray(\"Documentation: https://rebase.pro/docs\")}\n${telemetryNotice()}`);\n}\n\n/**\n * One line about usage sharing, in the global help.\n *\n * Every other tool that collects anything prints a first-run notice. Ours asks\n * at the end of `rebase init` — but someone who installs the CLI and never runs\n * `init`, or who joins a project someone else scaffolded, would otherwise never\n * learn the subsystem exists. This is the cheapest place to close that: the\n * help is what an unfamiliar user reads first.\n *\n * It states the current setting rather than a generic sentence, so it is also\n * the fastest answer to \"is this thing on?\".\n */\nfunction telemetryNotice(): string {\n const sharing = isEnabled();\n return chalk.gray(\n `Usage sharing: ${sharing ? \"on\" : \"off\"} — ${chalk.cyan(\"rebase telemetry\")} to inspect or change\\n`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,sBAA4B;CACjC,IAAI,QAAQ,IAAI,wBAAwB,KAAA,GACpC,QAAQ,IAAI,sBAAsB;AAE1C;;;;;;;;;;;;;;AAeA,IAAa,aAAa;CACtB,aAAa;CACb,UAAU;CACV,WAAW;CACX,MAAM;CACN,MAAM;AACV;;;;;;AAOA,IAAM,qBAAqB;CAAC;CAAQ;CAAU;CAAM;CAAW;CAAO;CAAS;CAAS;CAAQ;CAAU;CAAU;CAAU;CAAY;CAAW;CAAS;CAAQ;CAAS;CAAY;CAAgB;CAAa;CAAa;CAAU;CAAW;CAAW;CAAqB;CAAO;CAAQ;CAAS;CAAQ;CAAQ;CAAa;AAAK;AAQpV,IAAM,gBAAmC;CAAE,aAAa,CAAC;CAAG,SAAS,CAAC;AAAE;;;;;;;;;;AAWxE,eAAe,kBAAkB,SAA6C;CAC1E,QAAQ,SAAR;EACI,KAAK,UAAU,OAAO;GAAE,cAAc,MAAM,OAAO,wBAAA,CAAsB;GAAoB,SAAS,CAAC;EAAE;EACzG,KAAK,MAAM,OAAO;GAAE,cAAc,MAAM,OAAO,oB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