google-gemini / google-gemini/gemini-cli
Gemini CLI File Access Issues
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
### What happened?
The Gemini CLI agent experienced inconsistent and problematic behavior when attempting to read files from subdirectories using the _**read_file**_ and _**read_many_files**_ tools.
### What did you expect to happen?
### **Expected Behavior:**
1. `read_file(absolute_path='C:\\path\\to\\subdirectory\\file.py')` should successfully read the content of
the specified file.
2. `read_many_files(paths=['subdirectory/**/*.py'], respect_git_ignore=False)` should successfully read the
content of all Python files within the specified subdirectory and its subfolders.
### **Actual Behavior:**
1. `read_file`: Initially, read_file failed with contradictory error messages, such as "File path must be
within the root directory (c:\\gemini-cli)" and "File path must be absolute, but was relative." After
repeated attempts and careful path formatting, it eventually succeeded with absolute paths using
backslashes (e.g., C:\\gemini-cli\\components\\target.py). The initial failures were confusing and
hindered progress.
2. `read_many_files`: This tool consistently failed to read files when provided with glob patterns (e.g.,
components/**/*.py), even when respect_git_ignore=False was explicitly set. The error message returned
was "No files matching the criteria were found or all were skipped," despite the glob tool successfully
identifying files with the exact same pattern.
### Client information
* **CLI Version:** 0.1.7
* **Git Commit:** 55cc809
* **Operating System:** win32 v22.17.0
* **Sandbox Environment:** no sandbox
* **Model Version:** gemini-2.5-flash
* **Memory Usage:** 201.1 MB
### Login information
Logging in via Google Account
### Anything else we need to know?
### Impact:
These issues forced the agent to resort to less efficient workarounds, such as:
* Using run_shell_command with type (Windows equivalent of cat) to inspect file contents.
* Performing a glob search first to get a list of individual absolute paths, then iterating and calling
read_file for each file, rather than using read_many_files directly with glob patterns.
This significantly impacted the efficiency of file analysis and modification tasks.
Contributor guide
Assessment
This issue has not been assessed yet.