| 1 | import { execSync } from "child_process"; |
| 2 | |
| 3 | export async function shouldInstallSkill( |
| 4 | option: boolean | undefined, |
| 5 | interactive: boolean, |
| 6 | ): Promise<boolean> { |
| 7 | if (option !== undefined) return option; |
| 8 | if (!interactive) return false; |
| 9 | |
| 10 | try { |
| 11 | const { confirm } = await import("@inquirer/prompts"); |
| 12 | return await confirm({ |
| 13 | message: "Install the OpenUI agent skill for AI coding assistants?", |
| 14 | default: true, |
| 15 | }); |
| 16 | } catch (err) { |
| 17 | const { ExitPromptError } = await import("@inquirer/core"); |
| 18 | if (err instanceof ExitPromptError) { |
| 19 | process.exit(0); |
| 20 | } |
| 21 | throw err; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | export function runSkillInstall(targetDir: string): void { |
| 26 | console.info("\nInstalling OpenUI agent skill...\n"); |