Add --dangerously-overwrite-existing flag to bootstrap command

Allows re-running bootstrap to delete and recreate the superuser and
reviq org. Deletes all related records (tokens, sessions, passkeys, etc.)
before recreating.

Also configures stricli to use kebab-case for CLI flags globally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
RevIQ
2026-01-09 19:09:09 +08:00
parent cc77211969
commit 3031c88148
3 changed files with 102 additions and 8 deletions

View File

@@ -6,4 +6,10 @@ export const app = buildApplication(rootRouteMap, {
versionInfo: {
currentVersion: "0.0.0",
},
scanner: {
caseStyle: "allow-kebab-for-camel",
},
documentation: {
caseStyle: "convert-camel-to-kebab",
},
});

View File

@@ -6,6 +6,7 @@ import { writeConfig } from "../utils/config.js";
interface BootstrapFlags {
email: string;
password: string;
dangerouslyOverwriteExisting: boolean;
}
async function bootstrap(
@@ -22,6 +23,7 @@ async function bootstrap(
const result = await executeBootstrap(db, {
email: flags.email,
password: flags.password,
dangerouslyOverwriteExisting: flags.dangerouslyOverwriteExisting,
});
console.log(`Created superuser: ${result.user.email}`);
@@ -62,6 +64,11 @@ export const bootstrapCommand = buildCommand({
parse: String,
brief: "Password for the superuser",
},
dangerouslyOverwriteExisting: {
kind: "boolean",
brief: "Delete existing user and reviq org if they exist",
default: false,
},
},
},
docs: {