@@ -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,
@@ -211,18 +249,13 @@ export async function selectAgentTargetPaths({
211249
212250 if ( interactive && ! agent ) {
213251 const selectedAgents = await prompts . multiselect ( {
214- message :
215- 'Which agents are you using?\n ' +
216- styleText (
217- 'gray' ,
218- 'Writes an instruction file for each selected agent to help it understand `vp` commands and the project workflow.' ,
219- ) ,
252+ message : 'Which coding agent instruction files should Vite+ create?' ,
220253 options : AGENTS . map ( ( option ) => ( {
221254 label : option . label ,
222255 value : option . id ,
223- hint : option . targetPath ,
256+ hint : option . hint ,
224257 } ) ) ,
225- initialValues : [ 'chatgpt-codex' ] ,
258+ initialValues : [ AGENT_DEFAULT_ID ] ,
226259 required : false ,
227260 } ) ;
228261
@@ -237,7 +270,7 @@ export async function selectAgentTargetPaths({
237270 return resolveAgentTargetPaths ( selectedAgents ) ;
238271 }
239272
240- return resolveAgentTargetPaths ( agent ?? 'other' ) ;
273+ return resolveAgentTargetPaths ( agent ?? AGENT_DEFAULT_ID ) ;
241274}
242275
243276export async function selectAgentTargetPath ( {
@@ -359,9 +392,12 @@ function resolveSingleAgentTargetPath(agent: string) {
359392 const resolved = alias ? normalizeAgentName ( alias ) : normalized ;
360393 const match = AGENTS . find (
361394 ( option ) =>
362- normalizeAgentName ( option . id ) === resolved || normalizeAgentName ( option . label ) === resolved ,
395+ normalizeAgentName ( option . id ) === resolved ||
396+ normalizeAgentName ( option . label ) === resolved ||
397+ normalizeAgentName ( option . targetPath ) === resolved ||
398+ option . aliases ?. some ( ( candidate ) => normalizeAgentName ( candidate ) === resolved ) ,
363399 ) ;
364- return match ?. targetPath ?? AGENTS [ AGENTS . length - 1 ] . targetPath ;
400+ return match ?. targetPath ?? AGENT_STANDARD_PATH ;
365401}
366402
367403export interface AgentConflictInfo {
0 commit comments