MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / registerInitCommand

Function registerInitCommand

src/cli/commands/init.ts:447–651  ·  view source on GitHub ↗
(app: Argv, ctx?: { workspaceRoot: string })

Source from the content-addressed store, hash-verified

445}
446
447export 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

Callers 2

buildYargsAppFunction · 0.90
runInitCommandFunction · 0.85

Calls 15

isInteractiveTTYFunction · 0.90
createPrompterFunction · 0.90
readSkillContentFunction · 0.85
resolveTargetsFunction · 0.85
uninstallSkillFunction · 0.85
collectInitSelectionFunction · 0.85
enforceInstallPolicyFunction · 0.85
formatSkippedClientsFunction · 0.85
installSkillFunction · 0.85
ensureAgentsGuidanceFunction · 0.85
skillDisplayNameFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected