@@ -294,7 +294,7 @@ async function ensureAgentsGuidance(
294294 }
295295
296296 if ( ! force ) {
297- if ( ! process . stdin . isTTY ) {
297+ if ( ! isInteractiveTTY ( ) ) {
298298 throw new Error (
299299 `${ AGENTS_FILE_NAME } exists and requires confirmation to update. Re-run with --force to apply the change in non-interactive mode.` ,
300300 ) ;
@@ -325,6 +325,7 @@ const CUSTOM_PATH_SENTINEL = '__custom__';
325325interface InitSelection {
326326 skillType : SkillType ;
327327 targets : ClientInfo [ ] ;
328+ selectionMode : 'flags_or_dest' | 'interactive' ;
328329}
329330
330331async function collectInitSelection (
@@ -369,12 +370,13 @@ async function collectInitSelection(
369370 return {
370371 skillType,
371372 targets : [ { name : 'Custom' , id : 'custom' , skillsDir : resolvedDest } ] ,
373+ selectionMode : 'flags_or_dest' ,
372374 } ;
373375 }
374376
375377 if ( argv . client !== undefined ) {
376378 const targets = resolveTargets ( argv . client , undefined , 'install' ) ;
377- return { skillType, targets } ;
379+ return { skillType, targets, selectionMode : 'flags_or_dest' } ;
378380 }
379381
380382 if ( ! interactive ) {
@@ -429,7 +431,7 @@ async function collectInitSelection(
429431 }
430432 }
431433
432- return { skillType, targets } ;
434+ return { skillType, targets, selectionMode : 'interactive' } ;
433435}
434436
435437async function promptCustomPath ( ) : Promise < string > {
@@ -585,6 +587,7 @@ export function registerInitCommand(app: Argv, ctx?: { workspaceRoot: string }):
585587 selection . skillType ,
586588 clientFlag ,
587589 destFlag ,
590+ selection . selectionMode ,
588591 ) ;
589592
590593 if ( policy . allowedTargets . length === 0 ) {
@@ -667,6 +670,7 @@ function enforceInstallPolicy(
667670 skillType : SkillType ,
668671 clientFlag : string | undefined ,
669672 destFlag : string | undefined ,
673+ selectionMode : InitSelection [ 'selectionMode' ] ,
670674) : InstallPolicyResult {
671675 if ( skillType !== 'mcp' ) {
672676 return { allowedTargets : targets , skippedClients : [ ] } ;
@@ -694,5 +698,9 @@ function enforceInstallPolicy(
694698 allowedTargets . push ( target ) ;
695699 }
696700
701+ if ( clientFlag === 'claude' || selectionMode === 'interactive' ) {
702+ return { allowedTargets : targets , skippedClients : [ ] } ;
703+ }
704+
697705 return { allowedTargets, skippedClients } ;
698706}
0 commit comments