diff options
Diffstat (limited to 'docs/cli')
| -rw-r--r-- | docs/cli/commands.md | 3 | ||||
| -rw-r--r-- | docs/cli/configuration.md | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/docs/cli/commands.md b/docs/cli/commands.md index a47f643e..0da4802a 100644 --- a/docs/cli/commands.md +++ b/docs/cli/commands.md @@ -43,7 +43,7 @@ Slash commands provide meta-level control over the CLI itself. They can typicall ## At Commands (`@`) -At commands are used to quickly include the content of files or directories as part of your prompt to Gemini. +At commands are used to quickly include the content of files or directories as part of your prompt to Gemini. These commands now feature git-aware filtering. - **`@<path_to_file_or_directory>`** @@ -58,6 +58,7 @@ At commands are used to quickly include the content of files or directories as p - Spaces in paths should be escaped with a backslash (e.g., `@My\ Documents/file.txt`). - The command uses the `read_many_files` tool internally. The content is fetched and then prepended or inserted into your query before being sent to the Gemini model. - The text before and after the `@<path>` part of your query is preserved and sent along with the file content. + - **Git-Aware Filtering:** By default, git-ignored files (like `node_modules/`, `dist/`, `.env`, `.git/`) are automatically excluded. This behavior can be configured via the `fileFiltering` settings. - **File Types:** The command is intended for text-based files. While it might attempt to read any file, binary files or very large files might be skipped or truncated by the underlying `read_many_files` tool to ensure performance and relevance. The tool will typically indicate if files were skipped. - **Output:** The CLI will show a tool call message indicating that `read_many_files` was used, along with an improved display message detailing the status (e.g., number of files read, total size) and the path(s) that were processed. diff --git a/docs/cli/configuration.md b/docs/cli/configuration.md index da5a6bfd..4367e73e 100644 --- a/docs/cli/configuration.md +++ b/docs/cli/configuration.md @@ -42,6 +42,22 @@ When you create a `.gemini/settings.json` file for project-specific settings, or - **Default:** `GEMINI.md` - **Example:** `"contextFileName": "AGENTS.md"` +- **`fileFiltering`** (object, optional): + + - **Description:** Controls git-aware file filtering behavior for @ commands and file discovery tools. + - **Properties:** + - **`respectGitIgnore`** (boolean, default: `true`): Whether to respect .gitignore patterns when discovering files. When enabled, git-ignored files (like `node_modules/`, `dist/`, `.env`) are automatically excluded from @ commands and file listing operations. + - **`customIgnorePatterns`** (array of strings, default: `[]`): Additional patterns to ignore beyond git-ignored files. Useful for excluding specific directories or file types. + - **`allowBuildArtifacts`** (boolean, default: `false`): Whether to include build artifacts and generated files in file discovery operations. + - **Example:** + ```json + "fileFiltering": { + "respectGitIgnore": true, + "customIgnorePatterns": ["temp/", "*.log"], + "allowBuildArtifacts": false + } + ``` + - **`coreTools`** (array of strings, optional): - **Description:** Allows you to specify a list of core tool names that should be made available to the model. This can be used to restrict or customize the set of built-in tools. - **Example:** `"coreTools": ["ReadFileTool", "GlobTool", "SearchText"]`. |
