Skip to content

Commit 7c97e9d

Browse files
committed
fix(init): adapt MCP auto-install test for interactive wizard flow
The setup wizard requires explicit --client or --dest in non-interactive mode. Add --client auto to the test so it exercises the auto-detect policy path, and emit skip reasons before the zero-targets error.
1 parent af96d9d commit 7c97e9d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/cli/commands/__tests__/init.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('init command', () => {
202202
const yargs = (await import('yargs')).default;
203203
const mod = await loadInitModule();
204204

205-
const app = yargs(['init', '--skill', 'mcp']).scriptName('').fail(false);
205+
const app = yargs(['init', '--skill', 'mcp', '--client', 'auto']).scriptName('').fail(false);
206206
mod.registerInitCommand(app);
207207

208208
const stdoutSpy = vi.spyOn(process.stdout, 'write').mockImplementation(() => true);

src/cli/commands/init.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,9 @@ export function registerInitCommand(app: Argv, ctx?: { workspaceRoot: string }):
591591
);
592592

593593
if (policy.allowedTargets.length === 0) {
594+
for (const skipped of policy.skippedClients) {
595+
writeLine(`Skipped ${skipped.client}: ${skipped.reason}`);
596+
}
594597
const skippedSummary = formatSkippedClients(policy.skippedClients);
595598
const reasonSuffix = skippedSummary.length > 0 ? ` Skipped: ${skippedSummary}` : '';
596599
throw new Error(`No eligible install targets after applying skill policy.${reasonSuffix}`);

0 commit comments

Comments
 (0)