(app: Argv, ctx?: { workspaceRoot: string })
| 445 | } |
| 446 | |
| 447 | export function registerInitCommand(app: Argv, ctx?: { workspaceRoot: string }): void { |
| 448 | app.command( |
| 449 | 'init', |
| 450 | 'Install XcodeBuildMCP agent skill', |
| 451 | (yargs) => { |
| 452 | return yargs |
| 453 | .option('client', { |
| 454 | type: 'string', |
| 455 | describe: 'Target client: claude, agents (default: auto-detect)', |
| 456 | choices: ['auto', 'claude', 'agents'] as const, |
| 457 | }) |
| 458 | .option('skill', { |
| 459 | type: 'string', |
| 460 | describe: 'Skill variant: mcp or cli (default: cli)', |
| 461 | choices: ['mcp', 'cli'] as const, |
| 462 | }) |
| 463 | .option('dest', { |
| 464 | type: 'string', |
| 465 | describe: 'Custom destination directory (overrides --client)', |
| 466 | }) |
| 467 | .option('force', { |
| 468 | type: 'boolean', |
| 469 | default: false, |
| 470 | describe: 'Replace existing skill without prompting', |
| 471 | }) |
| 472 | .option('remove-conflict', { |
| 473 | type: 'boolean', |
| 474 | default: false, |
| 475 | describe: 'Auto-remove conflicting skill variant', |
| 476 | }) |
| 477 | .option('uninstall', { |
| 478 | type: 'boolean', |
| 479 | default: false, |
| 480 | describe: 'Remove the installed skill', |
| 481 | }) |
| 482 | .option('print', { |
| 483 | type: 'boolean', |
| 484 | default: false, |
| 485 | describe: 'Print the skill content to stdout instead of installing', |
| 486 | }); |
| 487 | }, |
| 488 | async (argv) => { |
| 489 | if (argv.print) { |
| 490 | const content = readSkillContent((argv.skill as SkillType | undefined) ?? 'cli'); |
| 491 | process.stdout.write(content); |
| 492 | return; |
| 493 | } |
| 494 | |
| 495 | const isTTY = isInteractiveTTY(); |
| 496 | const clientFlag = argv.client as string | undefined; |
| 497 | const destFlag = argv.dest as string | undefined; |
| 498 | |
| 499 | if (argv.uninstall) { |
| 500 | if (isTTY) { |
| 501 | clack.intro('XcodeBuildMCP Init'); |
| 502 | clack.log.info('Removing XcodeBuildMCP agent skills from detected AI clients.'); |
| 503 | } |
| 504 |
no test coverage detected