Adding list sub command to memoryCommand to list the path of GEMINI.md files (#10108)

Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
This commit is contained in:
sgnagnarella
2025-10-02 17:46:54 -04:00
committed by GitHub
parent 0713dd4d2d
commit 43bac6a038
8 changed files with 250 additions and 63 deletions
+24 -1
View File
@@ -83,7 +83,7 @@ export const memoryCommand: SlashCommand = {
try {
const config = await context.services.config;
if (config) {
const { memoryContent, fileCount } =
const { memoryContent, fileCount, filePaths } =
await loadServerHierarchicalMemory(
config.getWorkingDir(),
config.shouldLoadMemoryFromIncludeDirectories()
@@ -100,6 +100,7 @@ export const memoryCommand: SlashCommand = {
);
config.setUserMemory(memoryContent);
config.setGeminiMdFileCount(fileCount);
config.setGeminiMdFilePaths(filePaths);
const successMessage =
memoryContent.length > 0
@@ -126,5 +127,27 @@ export const memoryCommand: SlashCommand = {
}
},
},
{
name: 'list',
description: 'Lists the paths of the GEMINI.md files in use.',
kind: CommandKind.BUILT_IN,
action: async (context) => {
const filePaths = context.services.config?.getGeminiMdFilePaths() || [];
const fileCount = filePaths.length;
const messageContent =
fileCount > 0
? `There are ${fileCount} GEMINI.md file(s) in use:\n\n${filePaths.join('\n')}`
: 'No GEMINI.md files in use.';
context.ui.addItem(
{
type: MessageType.INFO,
text: messageContent,
},
Date.now(),
);
},
},
],
};