1- import { addMcpServers , AI_AGENT_LABELS , AI_AGENT_CHOICES , AIAgentTarget , copyAgentInstructionFiles , copyAISkillsToProject , GoogleAnalytics , InquirerWrapper , Util , VS_CODE_MCP_PATH } from "@igniteui/cli-core" ;
1+ import { addMcpServers , AI_AGENT_LABELS , AI_AGENT_CHOICES , AIAgentTarget , copyAgentInstructionFiles , copyAISkillsToProject , GoogleAnalytics , InquirerWrapper , Util , AiCodingAssistant , AI_ASSISTANT_MCP_CONFIGS } from "@igniteui/cli-core" ;
22import { ArgumentsCamelCase , CommandModule } from "yargs" ;
33
4- export function configureMCP ( ) : void {
5- const modified = addMcpServers ( VS_CODE_MCP_PATH ) ;
4+ export function configureMCP ( assistant : AiCodingAssistant = "vscode" ) : void {
5+ const { mcpFilePath } = AI_ASSISTANT_MCP_CONFIGS [ assistant ] ;
6+ const modified = addMcpServers ( assistant ) ;
67
78 if ( ! modified ) {
8- Util . log ( ` Ignite UI MCP servers already configured in ${ VS_CODE_MCP_PATH } ` ) ;
9+ Util . log ( ` Ignite UI MCP servers already configured in ${ mcpFilePath } ` ) ;
910 return ;
1011 }
11- Util . log ( Util . greenCheck ( ) + ` MCP servers configured in ${ VS_CODE_MCP_PATH } ` ) ;
12+ Util . log ( Util . greenCheck ( ) + ` MCP servers configured in ${ mcpFilePath } ` ) ;
1213}
1314
1415export function configureSkills ( agents : AIAgentTarget [ ] ) : void {
@@ -26,20 +27,31 @@ export function configureSkills(agents: AIAgentTarget[]): void {
2627 }
2728}
2829
29- export async function configure ( agents ?: AIAgentTarget [ ] , skills = true ) : Promise < void > {
30+ export async function configure ( agents ?: AIAgentTarget [ ] , skills = true , assistant : AiCodingAssistant = "vscode" ) : Promise < void > {
3031 if ( ! agents ?. length ) {
3132 agents = await promptForAgents ( ) ;
3233 }
3334 if ( ! agents . length ) return ;
34- configureMCP ( ) ;
35+ configureMCP ( assistant ) ;
3536 if ( skills ) {
3637 configureSkills ( agents ) ;
3738 }
3839 copyAgentInstructionFiles ( agents ) ;
3940}
4041const AI_AGENT_CHECKBOX_DEFAULTS : AIAgentTarget [ ] = [ "generic" , "claude" ] ;
42+
43+ const AI_ASSISTANT_CHOICES = Object . keys ( AI_ASSISTANT_MCP_CONFIGS ) as AiCodingAssistant [ ] ;
44+
45+ const AI_ASSISTANT_LABELS : Record < AiCodingAssistant , string > = {
46+ "vscode" : "VS Code (GitHub Copilot)" ,
47+ "cursor" : "Cursor" ,
48+ "claude-code" : "Claude Code" ,
49+ "gemini" : "Gemini" ,
50+ "junie" : "JetBrains Junie" ,
51+ } ;
52+
4153const AI_AGENT_CHECKBOX_CHOICES = [
42- { value : "none" , name : "None (skip AI configuration )" } ,
54+ { value : "none" , name : "None (skip skills and instructions )" } ,
4355 ...AI_AGENT_CHOICES . map ( agent => ( {
4456 value : agent ,
4557 name : AI_AGENT_LABELS [ agent ] ,
@@ -51,7 +63,7 @@ export async function promptForAgents(): Promise<AIAgentTarget[]> {
5163 let selected : AIAgentTarget [ ] = AI_AGENT_CHECKBOX_DEFAULTS ;
5264 if ( Util . canPrompt ( ) ) {
5365 const result = await InquirerWrapper . checkbox ( {
54- message : "Which AI tools do you want to generate configuration files for?" ,
66+ message : "Which AI agents do you want to generate skills and instructions for?" ,
5567 required : true ,
5668 choices : AI_AGENT_CHECKBOX_CHOICES
5769 } ) ;
@@ -60,6 +72,14 @@ export async function promptForAgents(): Promise<AIAgentTarget[]> {
6072 return selected ;
6173}
6274
75+ export async function promptForAssistant ( ) : Promise < AiCodingAssistant > {
76+ const selected = await InquirerWrapper . select ( {
77+ message : "Which coding assistant should MCP servers be configured for?" ,
78+ choices : AI_ASSISTANT_CHOICES . map ( a => ( { value : a , name : AI_ASSISTANT_LABELS [ a ] } ) )
79+ } ) ;
80+ return selected as AiCodingAssistant ;
81+ }
82+
6383const command : CommandModule = {
6484 command : "ai-config" ,
6585 describe : "Configures Ignite UI AI tooling (MCP servers, AI coding skills and instructions)" ,
@@ -70,23 +90,36 @@ const command: CommandModule = {
7090 describe : "AI agents/tools to generate configuration files for" ,
7191 choices : AI_AGENT_CHOICES ,
7292 type : "array"
93+ } )
94+ . option ( "assistant" , {
95+ describe : "Coding assistant to configure MCP servers for" ,
96+ choices : AI_ASSISTANT_CHOICES ,
97+ type : "string"
7398 } ) ,
7499 async handler ( argv : ArgumentsCamelCase ) {
75100 let agents = argv . agent as AIAgentTarget [ ] | undefined ;
101+ let assistant = argv . assistant as AiCodingAssistant | undefined ;
102+
76103 GoogleAnalytics . post ( {
77104 t : "screenview" ,
78105 cd : "Ai Config"
79106 } ) ;
80107
108+ if ( ! assistant ) {
109+ assistant = await promptForAssistant ( ) ;
110+ }
81111 if ( ! agents ?. length ) {
82112 agents = await promptForAgents ( ) ;
83113 }
114+
84115 GoogleAnalytics . post ( {
85116 t : "event" ,
86117 ec : "$ig ai-config" ,
87- ea : `agent: ${ agents . join ( ", " ) } `
118+ ea : `agent: ${ agents . join ( ", " ) || "none" } `
88119 } ) ;
89120
121+ configureMCP ( assistant ) ;
122+
90123 if ( ! agents . length ) {
91124 Util . log ( "No AI configuration selected. Skipping." ) ;
92125 return ;
0 commit comments