@@ -164,37 +164,75 @@ export function detectAgents(root: string): AgentConfig[] {
164164
165165// --- Backward-compatible exports ---
166166
167- const AGENT_ALIASES : Record < string , string > = {
168- chatgpt : 'chatgpt-codex' ,
169- codex : 'chatgpt-codex' ,
170- } ;
171-
172167export const AGENTS = [
173- { id : 'chatgpt-codex' , label : 'ChatGPT (Codex)' , targetPath : 'AGENTS.md' } ,
174- { id : 'claude' , label : 'Claude Code' , targetPath : 'CLAUDE.md' } ,
175- { id : 'gemini' , label : 'Gemini CLI' , targetPath : 'GEMINI.md' } ,
168+ {
169+ id : 'agents' ,
170+ label : 'AGENTS.md' ,
171+ targetPath : 'AGENTS.md' ,
172+ hint : 'Codex, Amp, OpenCode, and similar agents' ,
173+ aliases : [
174+ 'agents.md' ,
175+ 'chatgpt' ,
176+ 'chatgpt-codex' ,
177+ 'codex' ,
178+ 'amp' ,
179+ 'kilo' ,
180+ 'kilo-code' ,
181+ 'kiro' ,
182+ 'kiro-cli' ,
183+ 'opencode' ,
184+ 'other' ,
185+ ] ,
186+ } ,
187+ {
188+ id : 'claude' ,
189+ label : 'CLAUDE.md' ,
190+ targetPath : 'CLAUDE.md' ,
191+ hint : 'Claude Code' ,
192+ aliases : [ 'claude.md' , 'claude-code' ] ,
193+ } ,
194+ {
195+ id : 'gemini' ,
196+ label : 'GEMINI.md' ,
197+ targetPath : 'GEMINI.md' ,
198+ hint : 'Gemini CLI' ,
199+ aliases : [ 'gemini.md' , 'gemini-cli' ] ,
200+ } ,
176201 {
177202 id : 'copilot' ,
178- label : 'GitHub Copilot ' ,
203+ label : '.github/copilot-instructions.md ' ,
179204 targetPath : '.github/copilot-instructions.md' ,
205+ hint : 'GitHub Copilot' ,
206+ aliases : [ 'github-copilot' , 'copilot-instructions.md' ] ,
207+ } ,
208+ {
209+ id : 'cursor' ,
210+ label : '.cursor/rules/viteplus.mdc' ,
211+ targetPath : '.cursor/rules/viteplus.mdc' ,
212+ hint : 'Cursor' ,
213+ aliases : [ 'viteplus.mdc' ] ,
180214 } ,
181- { id : 'cursor' , label : 'Cursor' , targetPath : '.cursor/rules/viteplus.mdc' } ,
182215 {
183216 id : 'jetbrains' ,
184- label : 'JetBrains AI Assistant ' ,
217+ label : '.aiassistant/rules/viteplus.md ' ,
185218 targetPath : '.aiassistant/rules/viteplus.md' ,
219+ hint : 'JetBrains AI Assistant' ,
220+ aliases : [ 'jetbrains' , 'jetbrains-ai-assistant' , 'aiassistant' , 'viteplus.md' ] ,
186221 } ,
187- { id : 'amp' , label : 'Amp' , targetPath : 'AGENTS.md' } ,
188- { id : 'kiro' , label : 'Kiro' , targetPath : 'AGENTS.md' } ,
189- { id : 'opencode' , label : 'OpenCode' , targetPath : 'AGENTS.md' } ,
190- { id : 'other' , label : 'Other' , targetPath : 'AGENTS.md' } ,
191222] as const ;
192223
193224type AgentSelection = string | string [ ] | false ;
225+ const AGENT_DEFAULT_ID = 'agents' ;
194226const AGENT_STANDARD_PATH = 'AGENTS.md' ;
195227const AGENT_INSTRUCTIONS_START_MARKER = '<!--VITE PLUS START-->' ;
196228const AGENT_INSTRUCTIONS_END_MARKER = '<!--VITE PLUS END-->' ;
197229
230+ const AGENT_ALIASES = Object . fromEntries (
231+ AGENTS . flatMap ( ( option ) =>
232+ ( option . aliases ?? [ ] ) . map ( ( alias ) => [ normalizeAgentName ( alias ) , option . id ] ) ,
233+ ) ,
234+ ) as Record < string , string > ;
235+
198236export async function selectAgentTargetPaths ( {
199237 interactive,
200238 agent,
@@ -212,17 +250,17 @@ export async function selectAgentTargetPaths({
212250 if ( interactive && ! agent ) {
213251 const selectedAgents = await prompts . multiselect ( {
214252 message :
215- 'Which agents are you using ?\n ' +
253+ 'Which coding agent instruction files should Vite+ create ?\n ' +
216254 styleText (
217255 'gray' ,
218- 'Writes an instruction file for each selected agent to help it understand `vp` commands and the project workflow .' ,
256+ 'Choose every file you want to support. AGENTS.md works for Codex, Amp, OpenCode, and similar agents .' ,
219257 ) ,
220258 options : AGENTS . map ( ( option ) => ( {
221259 label : option . label ,
222260 value : option . id ,
223- hint : option . targetPath ,
261+ hint : option . hint ,
224262 } ) ) ,
225- initialValues : [ 'chatgpt-codex' ] ,
263+ initialValues : [ AGENT_DEFAULT_ID ] ,
226264 required : false ,
227265 } ) ;
228266
@@ -237,7 +275,7 @@ export async function selectAgentTargetPaths({
237275 return resolveAgentTargetPaths ( selectedAgents ) ;
238276 }
239277
240- return resolveAgentTargetPaths ( agent ?? 'other' ) ;
278+ return resolveAgentTargetPaths ( agent ?? AGENT_DEFAULT_ID ) ;
241279}
242280
243281export async function selectAgentTargetPath ( {
@@ -359,9 +397,12 @@ function resolveSingleAgentTargetPath(agent: string) {
359397 const resolved = alias ? normalizeAgentName ( alias ) : normalized ;
360398 const match = AGENTS . find (
361399 ( option ) =>
362- normalizeAgentName ( option . id ) === resolved || normalizeAgentName ( option . label ) === resolved ,
400+ normalizeAgentName ( option . id ) === resolved ||
401+ normalizeAgentName ( option . label ) === resolved ||
402+ normalizeAgentName ( option . targetPath ) === resolved ||
403+ option . aliases ?. some ( ( candidate ) => normalizeAgentName ( candidate ) === resolved ) ,
363404 ) ;
364- return match ?. targetPath ?? AGENTS [ AGENTS . length - 1 ] . targetPath ;
405+ return match ?. targetPath ?? AGENT_STANDARD_PATH ;
365406}
366407
367408export interface AgentConflictInfo {
0 commit comments