@rebasepro/cli 0.19.1-canary.g96b65b4 → 0.19.1-canary.g9b6d85f

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.
@@ -112,6 +112,36 @@ export declare function refuseAtlasOnManagedDatabase(rawArgs: string[], kind: st
112
112
  * cover. It does now.
113
113
  */
114
114
  export declare function refuseBranchOnManagedDatabase(rawArgs: string[], kind: string): void;
115
+ /**
116
+ * The one place this CLI spawns the driver's own CLI.
117
+ *
118
+ * There were three, each with its own copy of "tsx for a `.ts` entry, `node`
119
+ * otherwise". That rule was right only while the driver shipped `src/`; once it
120
+ * shipped `dist/cli.js` all three quietly switched to plain `node`, and the
121
+ * driver loads the PROJECT's TypeScript in process:
122
+ *
123
+ * - `schema stale` reads the collections, could not resolve `./authors` onto
124
+ * `authors.ts`, and answered "⏭ Not checked" while exiting 0;
125
+ * - `db push` does the same in `ensureAuthTables`, so `rebase.users` was never
126
+ * created and the push died at "Applying RLS policies" with
127
+ * `relation "rebase.users" does not exist` — on a virgin database, which is
128
+ * the documented bring-your-own-Postgres first run.
129
+ *
130
+ * Two were fixed and the third was missed, because three copies of a decision
131
+ * are three chances to miss one. There is one now, and a gate holds it at one.
132
+ *
133
+ * tsx whenever it is installed — a devDependency of every scaffold, for exactly
134
+ * this reason. Without it a `.ts` entry cannot run at all; a built entry still
135
+ * runs, and the subcommands that never touch the project's TypeScript still work.
136
+ */
137
+ export declare function spawnDriverCli(resolved: {
138
+ projectRoot: string;
139
+ backendDir: string;
140
+ pluginCli: string;
141
+ env: Record<string, string>;
142
+ }, childArgs: string[], options?: {
143
+ quiet?: boolean;
144
+ }): Promise<void>;
115
145
  /**
116
146
  * Run a `schema` subcommand through the active driver's CLI.
117
147
  *
package/dist/index.es.js CHANGED
@@ -2857,62 +2857,6 @@ function reportSpawnFailure(error) {
2857
2857
  if (message) console.error(chalk.red(`✗ ${message}`));
2858
2858
  }
2859
2859
  //#endregion
2860
- //#region src/utils/command-words.ts
2861
- /**
2862
- * The words that name a command, with the flags taken back out.
2863
- *
2864
- * `rawArgs` is the whole of `process.argv`, and reading the command's words at
2865
- * fixed indices off it assumes nothing precedes them. Something routinely does:
2866
- * `--debug` is what `bin/rebase.js` prints after every failure as the thing to
2867
- * re-run with, so it is the single most likely token to appear before a command
2868
- * word, and it shifted every index by one.
2869
- *
2870
- * What that cost is not a bad error message. `rebase db branch switch feature`
2871
- * writes a per-checkout pointer that the CLI owns; the driver, running as a
2872
- * child process, cannot persist it and does not try. The dispatch found
2873
- * `switch` by position, so `rebase --debug db branch switch feature` missed the
2874
- * CLI's branch and handed the line to the driver — which reported success and
2875
- * left the checkout on the main database. Every subsequent `dev`, `push` and
2876
- * `backup` then ran against the wrong database, believing it was the branch,
2877
- * which is the exact failure branching exists to prevent.
2878
- *
2879
- * The words are anchored on the command name rather than taken from position
2880
- * zero, because a flag written in the space form (`--database-url <url>`) leaves
2881
- * its value behind as a bare token and no parser at this level knows which
2882
- * flags take values. Anchoring survives that: the value would have to be the
2883
- * literal command name to fool it.
2884
- *
2885
- * Returns `[]` when the command name is not on the line at all.
2886
- */
2887
- function commandWords(rawArgs, command) {
2888
- const words = rawArgs.slice(2).filter((token) => !token.startsWith("-"));
2889
- const start = words.indexOf(command);
2890
- return start === -1 ? [] : words.slice(start);
2891
- }
2892
- /**
2893
- * The line to hand a spawned driver, starting at the command word.
2894
- *
2895
- * The same defect one layer down, and it does not degrade gracefully: the
2896
- * driver reads its domain from `args[0]`, so `rebase --debug db push` spawned
2897
- * it with `["--debug", "db", "push"]` and it answered "Unknown domain command:
2898
- * --debug" — for a flag the CLI itself tells you to add after any failure.
2899
- *
2900
- * Tokens written *before* the command word are moved after it rather than
2901
- * dropped. Dropping them would be the same class of bug in the other direction:
2902
- * `rebase --database-url postgres://… db push` would silently lose the flag that
2903
- * says which database to touch. Appending keeps each flag next to its value, and
2904
- * `arg` reads flags wherever they appear.
2905
- *
2906
- * Falls back to `rawArgs.slice(2)` when the command word is not on the line,
2907
- * which is what an internally synthesised argv looks like.
2908
- */
2909
- function argsFromCommand(rawArgs, command) {
2910
- const tail = rawArgs.slice(2);
2911
- const start = tail.findIndex((token) => token === command);
2912
- if (start <= 0) return [...tail];
2913
- return [...tail.slice(start), ...tail.slice(0, start)];
2914
- }
2915
- //#endregion
2916
2860
  //#region src/utils/unknown-command.ts
2917
2861
  /**
2918
2862
  * What every command family says when it does not recognise a subcommand.
@@ -3007,6 +2951,62 @@ function unknownCommand(typed, known, family = "") {
3007
2951
  process.exit(1);
3008
2952
  }
3009
2953
  //#endregion
2954
+ //#region src/utils/command-words.ts
2955
+ /**
2956
+ * The words that name a command, with the flags taken back out.
2957
+ *
2958
+ * `rawArgs` is the whole of `process.argv`, and reading the command's words at
2959
+ * fixed indices off it assumes nothing precedes them. Something routinely does:
2960
+ * `--debug` is what `bin/rebase.js` prints after every failure as the thing to
2961
+ * re-run with, so it is the single most likely token to appear before a command
2962
+ * word, and it shifted every index by one.
2963
+ *
2964
+ * What that cost is not a bad error message. `rebase db branch switch feature`
2965
+ * writes a per-checkout pointer that the CLI owns; the driver, running as a
2966
+ * child process, cannot persist it and does not try. The dispatch found
2967
+ * `switch` by position, so `rebase --debug db branch switch feature` missed the
2968
+ * CLI's branch and handed the line to the driver — which reported success and
2969
+ * left the checkout on the main database. Every subsequent `dev`, `push` and
2970
+ * `backup` then ran against the wrong database, believing it was the branch,
2971
+ * which is the exact failure branching exists to prevent.
2972
+ *
2973
+ * The words are anchored on the command name rather than taken from position
2974
+ * zero, because a flag written in the space form (`--database-url <url>`) leaves
2975
+ * its value behind as a bare token and no parser at this level knows which
2976
+ * flags take values. Anchoring survives that: the value would have to be the
2977
+ * literal command name to fool it.
2978
+ *
2979
+ * Returns `[]` when the command name is not on the line at all.
2980
+ */
2981
+ function commandWords(rawArgs, command) {
2982
+ const words = rawArgs.slice(2).filter((token) => !token.startsWith("-"));
2983
+ const start = words.indexOf(command);
2984
+ return start === -1 ? [] : words.slice(start);
2985
+ }
2986
+ /**
2987
+ * The line to hand a spawned driver, starting at the command word.
2988
+ *
2989
+ * The same defect one layer down, and it does not degrade gracefully: the
2990
+ * driver reads its domain from `args[0]`, so `rebase --debug db push` spawned
2991
+ * it with `["--debug", "db", "push"]` and it answered "Unknown domain command:
2992
+ * --debug" — for a flag the CLI itself tells you to add after any failure.
2993
+ *
2994
+ * Tokens written *before* the command word are moved after it rather than
2995
+ * dropped. Dropping them would be the same class of bug in the other direction:
2996
+ * `rebase --database-url postgres://… db push` would silently lose the flag that
2997
+ * says which database to touch. Appending keeps each flag next to its value, and
2998
+ * `arg` reads flags wherever they appear.
2999
+ *
3000
+ * Falls back to `rawArgs.slice(2)` when the command word is not on the line,
3001
+ * which is what an internally synthesised argv looks like.
3002
+ */
3003
+ function argsFromCommand(rawArgs, command) {
3004
+ const tail = rawArgs.slice(2);
3005
+ const start = tail.findIndex((token) => token === command);
3006
+ if (start <= 0) return [...tail];
3007
+ return [...tail.slice(start), ...tail.slice(0, start)];
3008
+ }
3009
+ //#endregion
3010
3010
  //#region src/dev-db/prepare.ts
3011
3011
  /**
3012
3012
  * The one place a command asks "which database, and how do I reach it?".
@@ -3192,122 +3192,6 @@ function managedNotices(prepared) {
3192
3192
  return lines;
3193
3193
  }
3194
3194
  //#endregion
3195
- //#region src/commands/schema.ts
3196
- /**
3197
- * CLI command: rebase schema <action>
3198
- */
3199
- async function schemaCommand(subcommand, rawArgs) {
3200
- if (!subcommand || subcommand === "--help" || wantsHelp(rawArgs)) {
3201
- printSchemaHelp(subcommand === "--help" ? void 0 : subcommand);
3202
- return;
3203
- }
3204
- if (!SCHEMA_ACTION_HELP[subcommand]) unknownCommand(subcommand, Object.keys(SCHEMA_ACTION_HELP), "schema");
3205
- const projectRoot = requireProjectRoot();
3206
- recordEvent("cli.schema", { subcommand: subcommand ?? "none" }, { projectRoot });
3207
- const backendDir = requireBackendDir(projectRoot);
3208
- const activePlugin = getActiveBackendPlugin(backendDir);
3209
- if (!activePlugin) {
3210
- console.error(chalk.red("✗ Could not detect an active database plugin."));
3211
- console.error(chalk.gray(" Make sure a package like @rebasepro/server-postgres is installed in backend/package.json."));
3212
- process.exit(1);
3213
- }
3214
- const pluginCli = resolvePluginCliScript(backendDir, activePlugin);
3215
- if (!pluginCli) exitDependenciesNotInstalled(projectRoot);
3216
- const envFile = findEnvFile(projectRoot);
3217
- const env = { ...process.env };
3218
- if (envFile) env.DOTENV_CONFIG_PATH = envFile;
3219
- env[DEV_DATABASE_KIND_ENV] = devDatabaseKind(projectRoot) ?? "";
3220
- try {
3221
- /**
3222
- * tsx, whether the driver CLI is source or built.
3223
- *
3224
- * This chose the interpreter from the file extension — tsx for a `.ts`
3225
- * entry, `node` for a built one — which was right only for as long as
3226
- * the driver shipped `src/`. Once it shipped `dist/cli.js`, the built
3227
- * CLI ran under plain `node`, and some of its subcommands load the
3228
- * PROJECT's collections in process. `schema stale` does: on the stock
3229
- * scaffold, whose collections import each other, Node could not resolve
3230
- * `./authors` onto `authors.ts` and the command reported "⏭ Not
3231
- * checked" — answering "is the generated schema stale?" with nothing,
3232
- * and exiting 0.
3233
- *
3234
- * The same rule lives in `execDriverCli` (commands/db.ts). Two copies of
3235
- * one decision is how they came to disagree; this one is kept because
3236
- * `schema` deliberately does NOT resolve a database, and `execDriverCli`
3237
- * is reached through a path that does.
3238
- */
3239
- const tsxBin = resolveTsx(projectRoot);
3240
- if (!tsxBin && pluginCli.endsWith(".ts")) exitDependenciesNotInstalled(projectRoot);
3241
- await execa(tsxBin ?? "node", [pluginCli, ...argsFromCommand(rawArgs, "schema")], {
3242
- cwd: backendDir,
3243
- stdio: "inherit",
3244
- env
3245
- });
3246
- } catch (error) {
3247
- reportSpawnFailure(error);
3248
- process.exit(1);
3249
- }
3250
- }
3251
- /** One page per subcommand, so `rebase schema <action> --help` says something. */
3252
- var SCHEMA_ACTION_HELP = {
3253
- generate: {
3254
- usage: "rebase schema generate [--collections <dir>] [--output <file>] [--watch]",
3255
- summary: "Generate the Drizzle schema from the collection definitions.",
3256
- notes: ["--watch regenerates on every change to a collection file."]
3257
- },
3258
- introspect: {
3259
- usage: "rebase schema introspect [--collections <dir>] [--output <dir>] [--schema <name>] [--force]",
3260
- summary: "Read an existing database and write Rebase collection definitions from it.",
3261
- notes: ["--force overwrites collection files that are already there."]
3262
- },
3263
- stale: {
3264
- usage: "rebase schema stale [--collections <dir>] [--output <file>] [--fix]",
3265
- summary: "Report generated schema files that no longer match the collections.",
3266
- notes: ["--fix regenerates them instead of only reporting."]
3267
- }
3268
- };
3269
- function printSchemaHelp(action) {
3270
- const entry = action ? SCHEMA_ACTION_HELP[action] : void 0;
3271
- if (entry) {
3272
- console.log(`
3273
- ${chalk.bold(`rebase schema ${action}`)}
3274
-
3275
- ${entry.summary}
3276
-
3277
- ${chalk.green.bold("Usage")}
3278
- ${chalk.blue(entry.usage)}
3279
- ${entry.notes?.length ? `\n${chalk.green.bold("Notes")}\n${entry.notes.map((n) => ` ${chalk.gray(`• ${n}`)}`).join("\n")}\n` : ""}
3280
- ${chalk.gray("Run `rebase schema --help` for every subcommand.")}
3281
- `);
3282
- return;
3283
- }
3284
- console.log(`
3285
- ${chalk.bold("rebase schema")} — Schema management commands
3286
-
3287
- ${chalk.green.bold("Usage")}
3288
- rebase schema ${chalk.blue("<command>")} [options]
3289
-
3290
- ${chalk.green.bold("Commands")}
3291
- ${chalk.gray("(Commands are provided by your active database driver plugin)")}
3292
- ${chalk.blue.bold("generate")} Generate Schema from collection definitions
3293
- ${chalk.blue.bold("introspect")} Introspect an existing database to generate collection definitions
3294
- ${chalk.blue.bold("stale")} Report generated schema files that no longer match the collections
3295
-
3296
- ${chalk.green.bold("generate Options")}
3297
- ${chalk.blue("--collections, -c")} Path to collections directory
3298
- ${chalk.blue("--output, -o")} Output path for generated schema
3299
- ${chalk.blue("--watch, -w")} Watch for changes and regenerate automatically
3300
-
3301
- ${chalk.green.bold("introspect Options")}
3302
- ${chalk.blue("--output, -o")} Output directory for generated collection files
3303
- ${chalk.blue("--schema")} Postgres schema to read (default: public)
3304
- ${chalk.blue("--force, -f")} Overwrite collection files that already exist
3305
-
3306
- ${chalk.green.bold("stale Options")}
3307
- ${chalk.blue("--fix")} Regenerate the stale files instead of only reporting them
3308
- `);
3309
- }
3310
- //#endregion
3311
3195
  //#region src/commands/db.ts
3312
3196
  /**
3313
3197
  * CLI command: rebase db <action>
@@ -3601,42 +3485,41 @@ async function resolveDriverCli() {
3601
3485
  env
3602
3486
  };
3603
3487
  }
3604
- /** Run the resolved driver CLI with the given child arguments. */
3605
- async function execDriverCli(resolved, childArgs, options = {}) {
3488
+ /**
3489
+ * The one place this CLI spawns the driver's own CLI.
3490
+ *
3491
+ * There were three, each with its own copy of "tsx for a `.ts` entry, `node`
3492
+ * otherwise". That rule was right only while the driver shipped `src/`; once it
3493
+ * shipped `dist/cli.js` all three quietly switched to plain `node`, and the
3494
+ * driver loads the PROJECT's TypeScript in process:
3495
+ *
3496
+ * - `schema stale` reads the collections, could not resolve `./authors` onto
3497
+ * `authors.ts`, and answered "⏭ Not checked" while exiting 0;
3498
+ * - `db push` does the same in `ensureAuthTables`, so `rebase.users` was never
3499
+ * created and the push died at "Applying RLS policies" with
3500
+ * `relation "rebase.users" does not exist` — on a virgin database, which is
3501
+ * the documented bring-your-own-Postgres first run.
3502
+ *
3503
+ * Two were fixed and the third was missed, because three copies of a decision
3504
+ * are three chances to miss one. There is one now, and a gate holds it at one.
3505
+ *
3506
+ * tsx whenever it is installed — a devDependency of every scaffold, for exactly
3507
+ * this reason. Without it a `.ts` entry cannot run at all; a built entry still
3508
+ * runs, and the subcommands that never touch the project's TypeScript still work.
3509
+ */
3510
+ async function spawnDriverCli(resolved, childArgs, options = {}) {
3606
3511
  const { projectRoot, backendDir, pluginCli, env } = resolved;
3607
3512
  const stdio = options.quiet ? "pipe" : "inherit";
3608
- /**
3609
- * tsx, whether the driver CLI is source or built.
3610
- *
3611
- * It used to be tsx only for a `.ts` entry, which happened to be right for
3612
- * as long as the driver shipped `src/`. Once it shipped `dist/cli.js`
3613
- * instead, this ran the built CLI under plain `node` — and some of its
3614
- * subcommands load the PROJECT's collections in process. `schema stale`
3615
- * does, so on every scaffold whose collections import each other (the stock
3616
- * one does) it failed to resolve them and reported "⏭ Not checked": a
3617
- * command that answers "is the generated schema stale?" with nothing at all,
3618
- * exiting 0, on the default project.
3619
- *
3620
- * Node cannot load a `.ts` file, and cannot resolve `./authors` or
3621
- * `./authors.js` onto `authors.ts`. tsx does both. It is a devDependency of
3622
- * every scaffold for exactly this reason.
3623
- */
3624
3513
  const tsxBin = resolveTsx(projectRoot);
3625
- if (tsxBin) {
3626
- await execa(tsxBin, [pluginCli, ...childArgs], {
3627
- cwd: backendDir,
3628
- stdio,
3629
- env
3630
- });
3631
- return;
3632
- }
3633
- if (pluginCli.endsWith(".ts")) throw new Error(dependenciesNotInstalled(projectRoot));
3634
- await execa("node", [pluginCli, ...childArgs], {
3514
+ if (!tsxBin && pluginCli.endsWith(".ts")) throw new Error(dependenciesNotInstalled(projectRoot));
3515
+ await execa(tsxBin ?? "node", [pluginCli, ...childArgs], {
3635
3516
  cwd: backendDir,
3636
3517
  stdio,
3637
3518
  env
3638
3519
  });
3639
3520
  }
3521
+ /** @deprecated Use {@link spawnDriverCli}. Kept as the internal name callers use. */
3522
+ var execDriverCli = spawnDriverCli;
3640
3523
  /**
3641
3524
  * Run a `schema` subcommand through the active driver's CLI.
3642
3525
  *
@@ -3679,21 +3562,12 @@ async function runDriverDbCommand(rawArgs, options = {}) {
3679
3562
  if (!options.quiet) for (const line of managedNotices(prepared)) console.log(chalk.gray(` ${line}`));
3680
3563
  refuseAtlasOnManagedDatabase(rawArgs, prepared.database.kind);
3681
3564
  const childArgs = absolutizeLocalPathArgs(argsFromCommand(rawArgs, "db"), process.cwd());
3682
- if (pluginCli.endsWith(".ts")) {
3683
- const tsxBin = resolveTsx(projectRoot);
3684
- if (!tsxBin) throw new Error(dependenciesNotInstalled(projectRoot));
3685
- await execa(tsxBin, [pluginCli, ...childArgs], {
3686
- cwd: backendDir,
3687
- stdio: "inherit",
3688
- env
3689
- });
3690
- return;
3691
- }
3692
- await execa("node", [pluginCli, ...childArgs], {
3693
- cwd: backendDir,
3694
- stdio: "inherit",
3565
+ await spawnDriverCli({
3566
+ projectRoot,
3567
+ backendDir,
3568
+ pluginCli,
3695
3569
  env
3696
- });
3570
+ }, childArgs, options);
3697
3571
  }
3698
3572
  async function dbCommand$1(subcommand, rawArgs) {
3699
3573
  if (!subcommand || subcommand === "--help" || rawArgs.includes("--help") || rawArgs.includes("-h")) {
@@ -4361,6 +4235,103 @@ function dbExamples(kind) {
4361
4235
  `;
4362
4236
  }
4363
4237
  //#endregion
4238
+ //#region src/commands/schema.ts
4239
+ /**
4240
+ * CLI command: rebase schema <action>
4241
+ */
4242
+ async function schemaCommand(subcommand, rawArgs) {
4243
+ if (!subcommand || subcommand === "--help" || wantsHelp(rawArgs)) {
4244
+ printSchemaHelp(subcommand === "--help" ? void 0 : subcommand);
4245
+ return;
4246
+ }
4247
+ if (!SCHEMA_ACTION_HELP[subcommand]) unknownCommand(subcommand, Object.keys(SCHEMA_ACTION_HELP), "schema");
4248
+ const projectRoot = requireProjectRoot();
4249
+ recordEvent("cli.schema", { subcommand: subcommand ?? "none" }, { projectRoot });
4250
+ const backendDir = requireBackendDir(projectRoot);
4251
+ const activePlugin = getActiveBackendPlugin(backendDir);
4252
+ if (!activePlugin) {
4253
+ console.error(chalk.red("✗ Could not detect an active database plugin."));
4254
+ console.error(chalk.gray(" Make sure a package like @rebasepro/server-postgres is installed in backend/package.json."));
4255
+ process.exit(1);
4256
+ }
4257
+ const pluginCli = resolvePluginCliScript(backendDir, activePlugin);
4258
+ if (!pluginCli) exitDependenciesNotInstalled(projectRoot);
4259
+ const envFile = findEnvFile(projectRoot);
4260
+ const env = { ...process.env };
4261
+ if (envFile) env.DOTENV_CONFIG_PATH = envFile;
4262
+ env[DEV_DATABASE_KIND_ENV] = devDatabaseKind(projectRoot) ?? "";
4263
+ try {
4264
+ await spawnDriverCli({
4265
+ projectRoot,
4266
+ backendDir,
4267
+ pluginCli,
4268
+ env
4269
+ }, argsFromCommand(rawArgs, "schema"));
4270
+ } catch (error) {
4271
+ reportSpawnFailure(error);
4272
+ process.exit(1);
4273
+ }
4274
+ }
4275
+ /** One page per subcommand, so `rebase schema <action> --help` says something. */
4276
+ var SCHEMA_ACTION_HELP = {
4277
+ generate: {
4278
+ usage: "rebase schema generate [--collections <dir>] [--output <file>] [--watch]",
4279
+ summary: "Generate the Drizzle schema from the collection definitions.",
4280
+ notes: ["--watch regenerates on every change to a collection file."]
4281
+ },
4282
+ introspect: {
4283
+ usage: "rebase schema introspect [--collections <dir>] [--output <dir>] [--schema <name>] [--force]",
4284
+ summary: "Read an existing database and write Rebase collection definitions from it.",
4285
+ notes: ["--force overwrites collection files that are already there."]
4286
+ },
4287
+ stale: {
4288
+ usage: "rebase schema stale [--collections <dir>] [--output <file>] [--fix]",
4289
+ summary: "Report generated schema files that no longer match the collections.",
4290
+ notes: ["--fix regenerates them instead of only reporting."]
4291
+ }
4292
+ };
4293
+ function printSchemaHelp(action) {
4294
+ const entry = action ? SCHEMA_ACTION_HELP[action] : void 0;
4295
+ if (entry) {
4296
+ console.log(`
4297
+ ${chalk.bold(`rebase schema ${action}`)}
4298
+
4299
+ ${entry.summary}
4300
+
4301
+ ${chalk.green.bold("Usage")}
4302
+ ${chalk.blue(entry.usage)}
4303
+ ${entry.notes?.length ? `\n${chalk.green.bold("Notes")}\n${entry.notes.map((n) => ` ${chalk.gray(`• ${n}`)}`).join("\n")}\n` : ""}
4304
+ ${chalk.gray("Run `rebase schema --help` for every subcommand.")}
4305
+ `);
4306
+ return;
4307
+ }
4308
+ console.log(`
4309
+ ${chalk.bold("rebase schema")} — Schema management commands
4310
+
4311
+ ${chalk.green.bold("Usage")}
4312
+ rebase schema ${chalk.blue("<command>")} [options]
4313
+
4314
+ ${chalk.green.bold("Commands")}
4315
+ ${chalk.gray("(Commands are provided by your active database driver plugin)")}
4316
+ ${chalk.blue.bold("generate")} Generate Schema from collection definitions
4317
+ ${chalk.blue.bold("introspect")} Introspect an existing database to generate collection definitions
4318
+ ${chalk.blue.bold("stale")} Report generated schema files that no longer match the collections
4319
+
4320
+ ${chalk.green.bold("generate Options")}
4321
+ ${chalk.blue("--collections, -c")} Path to collections directory
4322
+ ${chalk.blue("--output, -o")} Output path for generated schema
4323
+ ${chalk.blue("--watch, -w")} Watch for changes and regenerate automatically
4324
+
4325
+ ${chalk.green.bold("introspect Options")}
4326
+ ${chalk.blue("--output, -o")} Output directory for generated collection files
4327
+ ${chalk.blue("--schema")} Postgres schema to read (default: public)
4328
+ ${chalk.blue("--force, -f")} Overwrite collection files that already exist
4329
+
4330
+ ${chalk.green.bold("stale Options")}
4331
+ ${chalk.blue("--fix")} Regenerate the stale files instead of only reporting them
4332
+ `);
4333
+ }
4334
+ //#endregion
4364
4335
  //#region src/manifest.ts
4365
4336
  /**
4366
4337
  * Loading, validating and synthesizing `rebase.json`.