| 27 | const FRONTMATTER_DELIMITER = "---"; |
| 28 | |
| 29 | async function getProgram(repoRoot: string): Promise<Command> { |
| 30 | const filePath = resolve( |
| 31 | repoRoot, |
| 32 | "packages", |
| 33 | "cli", |
| 34 | "src", |
| 35 | "cli", |
| 36 | "index.ts", |
| 37 | ); |
| 38 | |
| 39 | if (!existsSync(filePath)) { |
| 40 | throw new Error(`CLI source file not found at ${filePath}`); |
| 41 | } |
| 42 | |
| 43 | const cliModule = (await import(pathToFileURL(filePath).href)) as { |
| 44 | default: Command; |
| 45 | }; |
| 46 | |
| 47 | return cliModule.default; |
| 48 | } |
| 49 | |
| 50 | function slugifyCommandName(name: string): string { |
| 51 | const slug = name |