gemini-cli

Multi File Read Tool (read_many_files)

This document describes the read_many_files tool for the Gemini CLI.

Description

Use read_many_files to read content from multiple files specified by paths or glob patterns. The behavior of this tool depends on the provided files:

read_many_files can be used to perform tasks such as getting an overview of a codebase, finding where specific functionality is implemented, reviewing documentation, or gathering context from multiple configuration files.

Note: read_many_files looks for files following the provided paths or glob patterns. A directory path such as "/docs" will return an empty result; the tool requires a pattern such as "/docs/*" or "/docs/*.md" to identify the relevant files.

Arguments

read_many_files takes the following arguments:

How to use read_many_files with the Gemini CLI

read_many_files searches for files matching the provided paths and include patterns, while respecting exclude patterns and default excludes (if enabled).

Usage:

read_many_files(paths=["Your files or paths here."], include=["Additional files to include."], exclude=["Files to exclude."], recursive=False, useDefaultExcludes=false, respect_git_ignore=true)

read_many_files examples

Read all TypeScript files in the src directory:

read_many_files(paths=["src/**/*.ts"])

Read the main README, all Markdown files in the docs directory, and a specific logo image, excluding a specific file:

read_many_files(paths=["README.md", "docs/**/*.md", "assets/logo.png"], exclude=["docs/OLD_README.md"])

Read all JavaScript files but explicitly include test files and all JPEGs in an images folder:

read_many_files(paths=["**/*.js"], include=["**/*.test.js", "images/**/*.jpg"], useDefaultExcludes=False)

Important notes