Support Cross-Folder File Referencing in Gemini CLI Sessions

  1. Description: Currently, Gemini CLI restricts file access to the immediate directory (sandbox/workspace) where the CLI session is started. When working within a subfolder (which contains project-specific GEMINI.md and RAG data), it is not possible to directly reference files or GEMINI.md context from parent folders, sibling folders, or other parts of the project hierarchy without moving or copying files manually.

    Requested Enhancement: Enable referencing of files and folders that reside outside of the current working (sandboxed) directory via both relative and absolute paths in prompts and GEMINI.md files. Allow explicit inclusion of multiple arbitrary directories as part of the active workspace, preferably via both initial config options and runtime commands (e.g., /directory add ). Enhance the context loading mechanism so GEMINI.md or RAG data from parent or shared folders can be modularly referenced without violating security/sandboxing controls. If direct file access needs to be restricted for security, provide clear user options and warnings to balance convenience and protection.

    Rationale: This feature would allow users with complex, modular, or multi-project repositories to avoid unnecessary duplication, maintain DRY documentation/practices, and improve organization. It is especially valuable for advanced workflows where code, docs, and context are structured across a hierarchy. Other modern tools support multi-root workspaces, so adding this to Gemini CLI would enhance usability and developer adoption.

    Example Use Cases: Referencing a shared GEMINI.md or context file from various subprojects without copying it multiple times. Including and comparing files or folders from sibling, parent, or external directories in a single Gemini CLI task. Enabling team-wide conventions by maintaining a central context file imported from any subdirectory.

Hi @davdelven Welcome to the AI Forum!

Thank you for your feedback. We appreciate you taking the time to share your thoughts with us, and we’ll be filing a feature request.

1 Like