Extensibility: Gemini.md files (#944)

This commit is contained in:
matt korwel
2025-06-11 13:34:35 -07:00
committed by GitHub
parent 24c61147b8
commit 4160d904da
7 changed files with 139 additions and 27 deletions

View File

@@ -112,6 +112,7 @@ async function parseArguments(): Promise<CliArgs> {
export async function loadHierarchicalGeminiMemory(
currentWorkingDirectory: string,
debugMode: boolean,
extensionContextFilePaths: string[] = [],
): Promise<{ memoryContent: string; fileCount: number }> {
if (debugMode) {
logger.debug(
@@ -120,7 +121,11 @@ export async function loadHierarchicalGeminiMemory(
}
// Directly call the server function.
// The server function will use its own homedir() for the global path.
return loadServerHierarchicalMemory(currentWorkingDirectory, debugMode);
return loadServerHierarchicalMemory(
currentWorkingDirectory,
debugMode,
extensionContextFilePaths,
);
}
export async function loadCliConfig(
@@ -145,10 +150,15 @@ export async function loadCliConfig(
setServerGeminiMdFilename(getCurrentGeminiMdFilename());
}
const extensionContextFilePaths = extensions
.map((e) => e.contextFileName)
.filter((p): p is string => !!p);
// Call the (now wrapper) loadHierarchicalGeminiMemory which calls the server's version
const { memoryContent, fileCount } = await loadHierarchicalGeminiMemory(
process.cwd(),
debugMode,
extensionContextFilePaths,
);
const contentGeneratorConfig = await createContentGeneratorConfig(argv);