@rebasepro/cli 0.25.1 → 0.26.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 (151) hide show
  1. package/README.md +2 -1
  2. package/bin/rebase.js +143 -4
  3. package/dist/{agent-setup-BYb2Tbdz.js → agent-setup-D9mHRZ5R.js} +125 -3
  4. package/dist/agent-setup-D9mHRZ5R.js.map +1 -0
  5. package/dist/{api-keys-CSMbsmAn.js → api-keys-CyJ26KEJ.js} +41 -9
  6. package/dist/api-keys-CyJ26KEJ.js.map +1 -0
  7. package/dist/{apps-iBXNZhVN.js → apps-CnLDV5b6.js} +6 -6
  8. package/dist/{apps-iBXNZhVN.js.map → apps-CnLDV5b6.js.map} +1 -1
  9. package/dist/{atlas-dev-database-BusbHP6n.js → atlas-dev-database-BODqdCWt.js} +2 -2
  10. package/dist/{atlas-dev-database-BusbHP6n.js.map → atlas-dev-database-BODqdCWt.js.map} +1 -1
  11. package/dist/{auth-DRsTWPky.js → auth-dII2jCO1.js} +10 -7
  12. package/dist/auth-dII2jCO1.js.map +1 -0
  13. package/dist/{branch-pointer-Bn_FjNld.js → branch-pointer-BQUF6lYa.js} +1 -1
  14. package/dist/{build-et7Rccxi.js → build-Cza7ZQrp.js} +6 -6
  15. package/dist/{build-et7Rccxi.js.map → build-Cza7ZQrp.js.map} +1 -1
  16. package/dist/{bundle-DlqkDYSe.js → bundle-C6yEtMJ-.js} +53 -5
  17. package/dist/bundle-C6yEtMJ-.js.map +1 -0
  18. package/dist/bundle.d.ts +14 -0
  19. package/dist/{cloud-B-ZIjHrA.js → cloud-BdnmqQaZ.js} +8527 -4340
  20. package/dist/cloud-BdnmqQaZ.js.map +1 -0
  21. package/dist/collections-dir-DlvDhime.js +69 -0
  22. package/dist/collections-dir-DlvDhime.js.map +1 -0
  23. package/dist/commands/agent-setup.d.ts +58 -0
  24. package/dist/commands/api-keys.d.ts +13 -0
  25. package/dist/commands/cloud/activity.d.ts +25 -0
  26. package/dist/commands/cloud/app-key.d.ts +18 -0
  27. package/dist/commands/cloud/auth.d.ts +1 -0
  28. package/dist/commands/cloud/billing-invoices.d.ts +39 -0
  29. package/dist/commands/cloud/claim.d.ts +7 -0
  30. package/dist/commands/cloud/context.d.ts +115 -6
  31. package/dist/commands/cloud/deploy-summary.d.ts +162 -0
  32. package/dist/commands/cloud/deploy.d.ts +64 -0
  33. package/dist/commands/cloud/env.d.ts +24 -0
  34. package/dist/commands/cloud/index.d.ts +13 -1
  35. package/dist/commands/cloud/init.d.ts +143 -0
  36. package/dist/commands/cloud/login-flow.d.ts +51 -0
  37. package/dist/commands/cloud/notifications.d.ts +28 -0
  38. package/dist/commands/cloud/orgs.d.ts +13 -0
  39. package/dist/commands/cloud/previews.d.ts +123 -0
  40. package/dist/commands/cloud/resources.d.ts +68 -14
  41. package/dist/commands/cloud/runtime-logs.d.ts +176 -0
  42. package/dist/commands/cloud/service-key.d.ts +15 -0
  43. package/dist/commands/cloud/token-capabilities.d.ts +61 -8
  44. package/dist/commands/cloud/tokens.d.ts +18 -3
  45. package/dist/commands/cloud/usage.d.ts +63 -0
  46. package/dist/commands/dev.d.ts +10 -0
  47. package/dist/commands/doctor.d.ts +1 -1
  48. package/dist/commands/generate-view.d.ts +94 -0
  49. package/dist/commands/generate_sdk.d.ts +15 -0
  50. package/dist/commands/skills.d.ts +4 -3
  51. package/dist/commands/storage.d.ts +4 -0
  52. package/dist/commands/verify.d.ts +96 -0
  53. package/dist/{consent-BaB-eQKG.js → consent-BD7F29T3.js} +2 -2
  54. package/dist/{consent-BaB-eQKG.js.map → consent-BD7F29T3.js.map} +1 -1
  55. package/dist/{console-BlD9kjFW.js → console-BXB6-8GT.js} +12 -6
  56. package/dist/console-BXB6-8GT.js.map +1 -0
  57. package/dist/{context-DHiiiJ5C.js → context-GUxkZm-S.js} +481 -24
  58. package/dist/context-GUxkZm-S.js.map +1 -0
  59. package/dist/{daemon-DDMRbz4T.js → daemon-Cp7oNXth.js} +2 -2
  60. package/dist/{daemon-DDMRbz4T.js.map → daemon-Cp7oNXth.js.map} +1 -1
  61. package/dist/{db-9P6MnmdC.js → db-KzlqddGD.js} +37 -30
  62. package/dist/db-KzlqddGD.js.map +1 -0
  63. package/dist/{derive-MTdClnkc.js → derive-ae9UOoOB.js} +2 -2
  64. package/dist/{derive-MTdClnkc.js.map → derive-ae9UOoOB.js.map} +1 -1
  65. package/dist/{dev-BDN_OKXA.js → dev-DTqVMgB3.js} +59 -32
  66. package/dist/dev-DTqVMgB3.js.map +1 -0
  67. package/dist/{dev-preflight-FT9GbJVj.js → dev-preflight-Cxv3TiD1.js} +2 -2
  68. package/dist/{dev-preflight-FT9GbJVj.js.map → dev-preflight-Cxv3TiD1.js.map} +1 -1
  69. package/dist/{dev-server-CIZwAfZa.js → dev-server-OJsUGZEB.js} +2 -2
  70. package/dist/{dev-server-CIZwAfZa.js.map → dev-server-OJsUGZEB.js.map} +1 -1
  71. package/dist/{doctor-D8YXz7df.js → doctor-BRWOlqeG.js} +13 -11
  72. package/dist/doctor-BRWOlqeG.js.map +1 -0
  73. package/dist/{eject-izG2KjMo.js → eject-DABcDnPN.js} +3 -3
  74. package/dist/{eject-izG2KjMo.js.map → eject-DABcDnPN.js.map} +1 -1
  75. package/dist/{fold-static-CybSay_W.js → fold-static-BnAK-anQ.js} +3 -3
  76. package/dist/{fold-static-CybSay_W.js.map → fold-static-BnAK-anQ.js.map} +1 -1
  77. package/dist/generate-view-IFwCADvb.js +662 -0
  78. package/dist/generate-view-IFwCADvb.js.map +1 -0
  79. package/dist/{generate_sdk-B4R65oUV.js → generate_sdk-BvcWvoUh.js} +33 -7
  80. package/dist/generate_sdk-BvcWvoUh.js.map +1 -0
  81. package/dist/index.es.js +57 -38
  82. package/dist/index.es.js.map +1 -1
  83. package/dist/{init-DYaeppEN.js → init-CaU6GhwI.js} +8 -8
  84. package/dist/{init-DYaeppEN.js.map → init-CaU6GhwI.js.map} +1 -1
  85. package/dist/last-dev-database-DpW5dfoX.js +2 -0
  86. package/dist/{manifest-nvPdLlJY.js → manifest-BtzDy7KQ.js} +36 -3
  87. package/dist/{manifest-nvPdLlJY.js.map → manifest-BtzDy7KQ.js.map} +1 -1
  88. package/dist/{normalize-imports-BYw8ad87.js → normalize-imports-D0zXlM6g.js} +3 -3
  89. package/dist/{normalize-imports-BYw8ad87.js.map → normalize-imports-D0zXlM6g.js.map} +1 -1
  90. package/dist/{path-flags-BFgG9V6y.js → path-flags-DNvtEi2-.js} +5 -4
  91. package/dist/path-flags-DNvtEi2-.js.map +1 -0
  92. package/dist/{prepare-1rVNd2PF.js → prepare-CTw9NEkh.js} +4 -4
  93. package/dist/{prepare-1rVNd2PF.js.map → prepare-CTw9NEkh.js.map} +1 -1
  94. package/dist/{project-g4K6kV1t.js → project-CasK56vN.js} +2 -2
  95. package/dist/{project-g4K6kV1t.js.map → project-CasK56vN.js.map} +1 -1
  96. package/dist/resolve-D647F1LA.js +2 -0
  97. package/dist/{resources-CovP8AZ-.js → resources-CPSC5Kcu.js} +4 -4
  98. package/dist/{resources-CovP8AZ-.js.map → resources-CPSC5Kcu.js.map} +1 -1
  99. package/dist/{schema-nuxvvc50.js → schema-BSXwZSiI.js} +9 -7
  100. package/dist/schema-BSXwZSiI.js.map +1 -0
  101. package/dist/{skills-DeUIsZcT.js → skills-BU2flMOy.js} +52 -7
  102. package/dist/skills-BU2flMOy.js.map +1 -0
  103. package/dist/{start-RzZqDroW.js → start-mVb6upwY.js} +5 -5
  104. package/dist/{start-RzZqDroW.js.map → start-mVb6upwY.js.map} +1 -1
  105. package/dist/static-syntax-check.d.ts +64 -0
  106. package/dist/{status-D9Zm88NZ.js → status-BREvtzJm.js} +7 -7
  107. package/dist/{status-D9Zm88NZ.js.map → status-BREvtzJm.js.map} +1 -1
  108. package/dist/{storage-BB3umRfw.js → storage-DtOXGflp.js} +159 -15
  109. package/dist/storage-DtOXGflp.js.map +1 -0
  110. package/dist/{telemetry-HfU5uAh1.js → telemetry-CgwJPVMO.js} +2 -2
  111. package/dist/{telemetry-HfU5uAh1.js.map → telemetry-CgwJPVMO.js.map} +1 -1
  112. package/dist/{telemetry-TseNLk6X.js → telemetry-DwK5RQJl.js} +4 -4
  113. package/dist/{telemetry-TseNLk6X.js.map → telemetry-DwK5RQJl.js.map} +1 -1
  114. package/dist/{upgrade-apiPKKE_.js → upgrade-B7sVwL8S.js} +4 -4
  115. package/dist/{upgrade-apiPKKE_.js.map → upgrade-B7sVwL8S.js.map} +1 -1
  116. package/dist/utils/collections-dir.d.ts +14 -0
  117. package/dist/utils/path-flags.d.ts +2 -1
  118. package/dist/utils/tool-stdio.d.ts +1 -1
  119. package/dist/verify-D7UsV_qe.js +730 -0
  120. package/dist/verify-D7UsV_qe.js.map +1 -0
  121. package/package.json +9 -7
  122. package/templates/eject/backend/src/index.ts +9 -1
  123. package/templates/generated-schemas/ecommerce.ts +3 -0
  124. package/templates/overlays/baas/ai-instructions.md +13 -0
  125. package/templates/template/.claude/hooks/post-edit-collection.sh +99 -0
  126. package/templates/template/.claude/settings.json +17 -0
  127. package/templates/template/.env.example +10 -1
  128. package/templates/template/ai-instructions.md +21 -1
  129. package/templates/template/config/collections/presets/ecommerce/index.ts +23 -0
  130. package/templates/template/docker-compose.yml +4 -1
  131. package/templates/template/frontend/package.json +1 -0
  132. package/templates/views/AppView.tsx.tmpl +138 -0
  133. package/templates/views/EntityView.tsx.tmpl +64 -0
  134. package/templates/views/index.ts.tmpl +8 -0
  135. package/dist/agent-setup-BYb2Tbdz.js.map +0 -1
  136. package/dist/api-keys-CSMbsmAn.js.map +0 -1
  137. package/dist/auth-DRsTWPky.js.map +0 -1
  138. package/dist/bundle-DlqkDYSe.js.map +0 -1
  139. package/dist/cloud-B-ZIjHrA.js.map +0 -1
  140. package/dist/console-BlD9kjFW.js.map +0 -1
  141. package/dist/context-DHiiiJ5C.js.map +0 -1
  142. package/dist/db-9P6MnmdC.js.map +0 -1
  143. package/dist/dev-BDN_OKXA.js.map +0 -1
  144. package/dist/doctor-D8YXz7df.js.map +0 -1
  145. package/dist/generate_sdk-B4R65oUV.js.map +0 -1
  146. package/dist/last-dev-database-B_75fxZC.js +0 -2
  147. package/dist/path-flags-BFgG9V6y.js.map +0 -1
  148. package/dist/resolve-BQUAC3Wi.js +0 -2
  149. package/dist/schema-nuxvvc50.js.map +0 -1
  150. package/dist/skills-DeUIsZcT.js.map +0 -1
  151. package/dist/storage-BB3umRfw.js.map +0 -1
@@ -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 { requireProjectRoot } from \"./utils/project\";\nimport { parseCommandArgs } from \"./utils/args\";\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\", \"skills\", \"api-keys\", \"storage\", \"cloud\", \"apps\", \"eject\", \"generate-sdk\", \"telemetry\", \"resources\", \"status\", \"upgrade\", \"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 \"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 --collections ./c push` was\n * refused as an unknown db command `./c`, `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 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 const { flags: sdkArgs, help: sdkHelp } = parseCommandArgs({\n spec: {\n // `--collections`, as every other command spells it; the\n // older name stays an alias.\n \"--collections\": String,\n \"--collections-dir\": \"--collections\",\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 \"-c\": \"--collections\",\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. `./config/\n // collections` relative to wherever you happen to be standing meant\n // `rebase generate-sdk` worked from the repository root and threw\n // \"Collections 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 collectionsDir: sdkArgs[\"--collections\"] || path.join(sdkRoot, \"config/collections\"),\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 \"apps\": {\n const { appsCommand } = await import(\"./commands/apps\");\n await appsCommand(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 \"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(\"apps list\")} Show the apps this repository declares\n\n${chalk.green.bold(\"Schema\")}\n ${chalk.blue.bold(\"schema generate\")} Generate Drizzle schema from collections\n ${chalk.blue.bold(\"schema introspect\")} Introspect database → Rebase collections\n ${chalk.blue.bold(\"schema stale\")} Report generated schema files the collections 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(\"SDK\")}\n ${chalk.blue.bold(\"generate-sdk\")} Generate a typed TypeScript SDK from collections\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 collections, schema, and DB\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":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,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;CAAY;CAAW;CAAS;CAAQ;CAAS;CAAgB;CAAa;CAAa;CAAU;CAAW;AAAmB;AAQvP,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,oBAAA,CAAkB;GAAgB,SAAS,CAAC;EAAE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BAAiB,EAAE;IACnC,MAAM,KAAK,KAAK,iBAAiB,EAAE;IACnC,MAAM,KAAK,KAAK,iBAAiB,EAAE;IACnC,MAAM,KAAK,KAAK,UAAU,EAAE,GAAG,MAAM,KAAK,QAAQ,EAAE;;EAEtD,MAAM,MAAM,KAAK,cAAc,EAAE;IAC/B,MAAM,KAAK,KAAK,iBAAiB,EAAE,8CAA8C,MAAM,KAAK,sBAAsB,EAAE;IACpH,MAAM,KAAK,KAAK,cAAc,EAAE;;EAElC,MAAM,MAAM,KAAK,eAAe,EAAE;IAChC,MAAM,KAAK,KAAK,WAAW,EAAE;;EAE/B,MAAM,MAAM,KAAK,cAAc,EAAE;IAC/B,MAAM,KAAK,KAAK,aAAa,EAAE;IAC/B,MAAM,KAAK,KAAK,YAAY,EAAE;IAC9B,MAAM,KAAK,KAAK,cAAc,EAAE;IAChC,MAAM,KAAK,KAAK,qBAAqB,EAAE,iCAAiC,MAAM,KAAK,wBAAwB,EAAE;IAC7G,MAAM,KAAK,KAAK,OAAO,EAAE,GAAG,MAAM,KAAK,QAAQ,EAAE;;EAEnD,MAAM,MAAM,KAAK,SAAS,EAAE;IAC1B,MAAM,KAAK,eAAe,EAAE;IAC5B,MAAM,KAAK,YAAY,EAAE;IACzB,MAAM,KAAK,SAAS,EAAE,sDAAsD,MAAM,KAAK,qBAAqB,EAAE;;EAEhH,MAAM,KAAK,wCAAwC,EAAE;EACrD,gBAAgB,GAAG;AACrB;;;;;;;;;;;;;AAcA,SAAS,kBAA0B;CAC/B,MAAM,UAAU,UAAU;CAC1B,OAAO,MAAM,KACT,kBAAkB,UAAU,OAAO,MAAM,KAAK,MAAM,KAAK,kBAAkB,EAAE,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 { 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\", \"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 \"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 --collections ./c push` was\n * refused as an unknown db command `./c`, `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 const { flags: sdkArgs, help: sdkHelp } = parseCommandArgs({\n spec: {\n // `--collections`, as every other command spells it; the\n // older name stays an alias.\n \"--collections\": String,\n \"--collections-dir\": \"--collections\",\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 \"-c\": \"--collections\",\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. `./config/\n // collections` relative to wherever you happen to be standing meant\n // `rebase generate-sdk` worked from the repository root and threw\n // \"Collections 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 collectionsDir: sdkArgs[\"--collections\"]\n || (sdkHelp ? path.join(sdkRoot, \"config/collections\") : (await import(\"./utils/collections-dir\")).resolveCollectionsDir(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 \"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(\"apps list\")} Show the apps this repository declares\n\n${chalk.green.bold(\"Schema\")}\n ${chalk.blue.bold(\"schema generate\")} Generate Drizzle schema from collections\n ${chalk.blue.bold(\"schema introspect\")} Introspect database → Rebase collections\n ${chalk.blue.bold(\"schema stale\")} Report generated schema files the collections 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 collections\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 collections, schema, and DB\n ${chalk.blue.bold(\"verify\")} Check collections, 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":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,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;AAAmB;AAQ7Q,IAAM,gBAAmC;CAAE,aAAa,CA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KAAK,WAAW,EAAE;;EAE/B,MAAM,MAAM,KAAK,cAAc,EAAE;IAC/B,MAAM,KAAK,KAAK,aAAa,EAAE;IAC/B,MAAM,KAAK,KAAK,YAAY,EAAE;IAC9B,MAAM,KAAK,KAAK,cAAc,EAAE;IAChC,MAAM,KAAK,KAAK,qBAAqB,EAAE,iCAAiC,MAAM,KAAK,wBAAwB,EAAE;IAC7G,MAAM,KAAK,KAAK,OAAO,EAAE,GAAG,MAAM,KAAK,QAAQ,EAAE;;EAEnD,MAAM,MAAM,KAAK,SAAS,EAAE;IAC1B,MAAM,KAAK,eAAe,EAAE;IAC5B,MAAM,KAAK,YAAY,EAAE;IACzB,MAAM,KAAK,SAAS,EAAE,sDAAsD,MAAM,KAAK,qBAAqB,EAAE;;EAEhH,MAAM,KAAK,wCAAwC,EAAE;EACrD,gBAAgB,GAAG;AACrB;;;;;;;;;;;;;AAcA,SAAS,kBAA0B;CAC/B,MAAM,UAAU,UAAU;CAC1B,OAAO,MAAM,KACT,kBAAkB,UAAU,OAAO,MAAM,KAAK,MAAM,KAAK,kBAAkB,EAAE,wBACjF;AACJ"}
@@ -1,14 +1,14 @@
1
- import { i as recordEvent, l as durationBucket } from "./telemetry-HfU5uAh1.js";
1
+ import { i as recordEvent, l as durationBucket } from "./telemetry-CgwJPVMO.js";
2
2
  import { n as getPMCommands, t as detectPackageManager } from "./package-manager-DSEOwTqM.js";
3
- import { C as wantsHelp, b as parseCommandArgs } from "./project-g4K6kV1t.js";
3
+ import { w as wantsHelp, x as parseCommandArgs } from "./project-CasK56vN.js";
4
4
  import { n as cliVersion } from "./version-Buyyo1ut.js";
5
- import { AGENTS, AGENT_KEYS, resolveAgentNames } from "./skills-DeUIsZcT.js";
6
- import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-BYb2Tbdz.js";
7
- import { W as resolveCloudUrl, Z as writeLink } from "./context-DHiiiJ5C.js";
5
+ import { AGENTS, AGENT_KEYS, resolveAgentNames } from "./skills-BU2flMOy.js";
6
+ import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-D9mHRZ5R.js";
7
+ import { $ as resolveCloudUrl, ct as writeLink } from "./context-GUxkZm-S.js";
8
8
  import { t as Refusal } from "./refusal-ReeeGP8a.js";
9
- import { r as dockerClaimedPorts } from "./dev-preflight-FT9GbJVj.js";
9
+ import { r as dockerClaimedPorts } from "./dev-preflight-Cxv3TiD1.js";
10
10
  import { t as invokedRebaseCommand } from "./invoked-command-CG_rIa_o.js";
11
- import { n as promptForConsent } from "./consent-BaB-eQKG.js";
11
+ import { n as promptForConsent } from "./consent-BD7F29T3.js";
12
12
  import chalk from "chalk";
13
13
  import fs from "fs";
14
14
  import path from "path";
@@ -1330,4 +1330,4 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
1330
1330
  //#endregion
1331
1331
  export { createRebaseApp };
1332
1332
 
1333
- //# sourceMappingURL=init-DYaeppEN.js.map
1333
+ //# sourceMappingURL=init-CaU6GhwI.js.map