Problem
The Gemini CLI enforces a 20MB file size limit for the read_file feature, but this important restriction is not documented anywhere in https://geminicli.com/docs or in docs/tools/file-system.md, docs/faq.md, or docs/troubleshooting.md. Users only discover the limit via obscure error messages or by inspecting the codebase.
Code Reference
The limit is hardcoded in:
const fileSizeInMB = stats.size / (1024 * 1024);
if (fileSizeInMB > 20) {
return {
llmContent: 'File size exceeds the 20MB limit.',
...
};
}
Opportunity
This restriction should be documented in the official docs, ideally in docs/tools/file-system.md alongside the read_file tool description. This would save users confusion and make the tool easier to use.
Minimal diff suggestion
Add a note to the read_file tool section, e.g.:
read_file (ReadFile)
Reads and returns the content of a specific file. Supports text, images, audio, and PDF.
Note: Files larger than 20MB cannot be read or uploaded. Attempts will result in an error: File size exceeds the 20MB limit.
Related files:
Problem
The Gemini CLI enforces a 20MB file size limit for the
read_filefeature, but this important restriction is not documented anywhere in https://geminicli.com/docs or indocs/tools/file-system.md,docs/faq.md, ordocs/troubleshooting.md. Users only discover the limit via obscure error messages or by inspecting the codebase.Code Reference
The limit is hardcoded in:
packages/core/src/utils/fileUtils.ts(seeprocessSingleFileContent)Opportunity
This restriction should be documented in the official docs, ideally in
docs/tools/file-system.mdalongside theread_filetool description. This would save users confusion and make the tool easier to use.Minimal diff suggestion
Add a note to the
read_filetool section, e.g.:read_file(ReadFile)Reads and returns the content of a specific file. Supports text, images, audio, and PDF.
Note: Files larger than 20MB cannot be read or uploaded. Attempts will result in an error:
File size exceeds the 20MB limit.Related files:
docs/tools/file-system.mdpackages/core/src/utils/fileUtils.ts