/** * Generate and optionally push a commit with changelog updates. */ import { Command, Flags } from "@f5-sales-demo/pi-utils/cli"; import { runCommitCommand } from "../commit"; import type { CommitCommandArgs } from "../commit/types"; import { initTheme } from "../modes/theme/theme"; export default class Commit extends Command { static description = "Generate a commit message and update changelogs"; static flags = { push: Flags.boolean({ description: "Push after committing" }), "dry-run": Flags.boolean({ description: "Preview without committing" }), "no-changelog": Flags.boolean({ description: "Skip changelog updates" }), legacy: Flags.boolean({ description: "Use legacy deterministic pipeline" }), context: Flags.string({ char: "c", description: "Additional context for the model" }), model: Flags.string({ char: "m", description: "Override model selection" }), }; async run(): Promise { const { flags } = await this.parse(Commit); const cmd: CommitCommandArgs = { push: flags.push ?? false, dryRun: flags["dry-run"] ?? false, noChangelog: flags["no-changelog"] ?? false, legacy: flags.legacy, context: flags.context, model: flags.model, }; await initTheme(); await runCommitCommand(cmd); } }