mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 22:44:45 -07:00
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:
@@ -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(),
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user