Files
bknd/app/src/cli/index.ts
dswbx 1128ac500d feat: add code-only tests and enhance CLI sync command with seeding option
Introduced a new test suite for code-only applications, validating app creation, database sync behavior, and seeding functionality. Enhanced the CLI sync command to include a seeding option, allowing for explicit seeding during database synchronization. Added error handling for unresolved config files in the run command.
2025-09-24 16:23:16 +02:00

40 lines
953 B
JavaScript

#!/usr/bin/env node
import { Command } from "commander";
import color from "picocolors";
import * as commands from "./commands";
import { getVersion } from "./utils/sys";
import { capture, flush, init } from "cli/utils/telemetry";
const program = new Command();
async function main() {
await init();
capture("start");
const version = await getVersion();
program
.name("bknd")
.description(color.yellowBright("⚡") + " bknd cli " + color.bold(color.cyan(`v${version}`)))
.version(version)
.hook("preAction", (thisCommand, actionCommand) => {
capture(`cmd_${actionCommand.name()}`);
})
.hook("postAction", async () => {
await flush();
});
// register commands
for (const command of Object.values(commands)) {
command(program);
}
await program.parseAsync();
}
main()
.then(null)
.catch(async (e) => {
await flush();
console.error(e);
});