diff options
| author | Vladislav Semyanov <[email protected]> | 2025-06-29 06:26:38 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-28 23:26:38 +0000 |
| commit | f31b1274bfa745566197eee67cc820a35046c96e (patch) | |
| tree | 5415f0f4a776b8b06e0f874636a1b30e977853fe /docs/tools/file-system.md | |
| parent | fbb3a2e6f05a67940a542165f6a9fe30c4f5211d (diff) | |
docs: remove duplicate tool descriptions in file-system.md (#1790)
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'docs/tools/file-system.md')
| -rw-r--r-- | docs/tools/file-system.md | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/docs/tools/file-system.md b/docs/tools/file-system.md index c29f086a..05a8f512 100644 --- a/docs/tools/file-system.md +++ b/docs/tools/file-system.md @@ -21,19 +21,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - Sorts entries with directories first, then alphabetically. - **Output (`llmContent`):** A string like: `Directory listing for /path/to/your/folder:\n[DIR] subfolder1\nfile1.txt\nfile2.png` - **Confirmation:** No. -- **Tool name:** `list_directory` -- **Display name:** ReadFolder -- **File:** `ls.ts` -- **Parameters:** - - `path` (string, required): The absolute path to the directory to list. - - `ignore` (array of strings, optional): A list of glob patterns to exclude from the listing (e.g., `["*.log", ".git"]`). - - `respect_git_ignore` (boolean, optional): Whether to respect `.gitignore` patterns when listing files. Defaults to `true`. -- **Behavior:** - - Returns a list of file and directory names. - - Indicates whether each entry is a directory. - - Sorts entries with directories first, then alphabetically. -- **Output (`llmContent`):** A string like: `Directory listing for /path/to/your/folder:\n[DIR] subfolder1\nfile1.txt\nfile2.png` -- **Confirmation:** No. ## 2. `read_file` (ReadFile) @@ -55,22 +42,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - For image/PDF files: An object containing `inlineData` with `mimeType` and base64 `data` (e.g., `{ inlineData: { mimeType: 'image/png', data: 'base64encodedstring' } }`). - For other binary files: A message like `Cannot display content of binary file: /path/to/data.bin`. - **Confirmation:** No. -- **Tool name:** `read_file` -- **Display name:** ReadFile -- **File:** `read-file.ts` -- **Parameters:** - - `path` (string, required): The absolute path to the file to read. - - `offset` (number, optional): For text files, the 0-based line number to start reading from. Requires `limit` to be set. - - `limit` (number, optional): For text files, the maximum number of lines to read. If omitted, reads a default maximum (e.g., 2000 lines) or the entire file if feasible. -- **Behavior:** - - For text files: Returns the content. If `offset` and `limit` are used, returns only that slice of lines. Indicates if content was truncated due to line limits or line length limits. - - For image and PDF files: Returns the file content as a base64-encoded data structure suitable for model consumption. - - For other binary files: Attempts to identify and skip them, returning a message indicating it's a generic binary file. -- **Output:** (`llmContent`): - - For text files: The file content, potentially prefixed with a truncation message (e.g., `[File content truncated: showing lines 1-100 of 500 total lines...]\nActual file content...`). - - For image/PDF files: An object containing `inlineData` with `mimeType` and base64 `data` (e.g., `{ inlineData: { mimeType: 'image/png', data: 'base64encodedstring' } }`). - - For other binary files: A message like `Cannot display content of binary file: /path/to/data.bin`. -- **Confirmation:** No. ## 3. `write_file` (WriteFile) @@ -87,17 +58,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - Creates parent directories if they don't exist. - **Output (`llmContent`):** A success message, e.g., `Successfully overwrote file: /path/to/your/file.txt` or `Successfully created and wrote to new file: /path/to/new/file.txt`. - **Confirmation:** Yes. Shows a diff of changes and asks for user approval before writing. -- **Tool name:** `write_file` -- **Display name:** WriteFile -- **File:** `write-file.ts` -- **Parameters:** - - `file_path` (string, required): The absolute path to the file to write to. - - `content` (string, required): The content to write into the file. -- **Behavior:** - - Writes the provided `content` to the `file_path`. - - Creates parent directories if they don't exist. -- **Output (`llmContent`):** A success message, e.g., `Successfully overwrote file: /path/to/your/file.txt` or `Successfully created and wrote to new file: /path/to/new/file.txt`. -- **Confirmation:** Yes. Shows a diff of changes and asks for user approval before writing. ## 4. `glob` (FindFiles) @@ -117,20 +77,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - Ignores common nuisance directories like `node_modules` and `.git` by default. - **Output (`llmContent`):** A message like: `Found 5 file(s) matching "*.ts" within src, sorted by modification time (newest first):\nsrc/file1.ts\nsrc/subdir/file2.ts...` - **Confirmation:** No. -- **Tool name:** `glob` -- **Display name:** FindFiles -- **File:** `glob.ts` -- **Parameters:** - - `pattern` (string, required): The glob pattern to match against (e.g., `"*.py"`, `"src/**/*.js"`). - - `path` (string, optional): The absolute path to the directory to search within. If omitted, searches the tool's root directory. - - `case_sensitive` (boolean, optional): Whether the search should be case-sensitive. Defaults to `false`. - - `respect_git_ignore` (boolean, optional): Whether to respect .gitignore patterns when finding files. Defaults to `true`. -- **Behavior:** - - Searches for files matching the glob pattern within the specified directory. - - Returns a list of absolute paths, sorted with the most recently modified files first. - - Ignores common nuisance directories like `node_modules` and `.git` by default. -- **Output (`llmContent`):** A message like: `Found 5 file(s) matching "*.ts" within src, sorted by modification time (newest first):\nsrc/file1.ts\nsrc/subdir/file2.ts...` -- **Confirmation:** No. ## 5. `search_file_content` (SearchText) @@ -147,17 +93,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - Uses `git grep` if available in a Git repository for speed, otherwise falls back to system `grep` or a JavaScript-based search. - Returns a list of matching lines, each prefixed with its file path (relative to the search directory) and line number. - **Output (`llmContent`):** A formatted string of matches, e.g.: -- **Tool name:** `search_file_content` -- **Display name:** SearchText -- **File:** `grep.ts` -- **Parameters:** - - `pattern` (string, required): The regular expression (regex) to search for (e.g., `"function\s+myFunction"`). - - `path` (string, optional): The absolute path to the directory to search within. Defaults to the current working directory. - - `include` (string, optional): A glob pattern to filter which files are searched (e.g., `"*.js"`, `"src/**/*.{ts,tsx}"`). If omitted, searches most files (respecting common ignores). -- **Behavior:** - - Uses `git grep` if available in a Git repository for speed, otherwise falls back to system `grep` or a JavaScript-based search. - - Returns a list of matching lines, each prefixed with its file path (relative to the search directory) and line number. -- **Output (`llmContent`):** A formatted string of matches, e.g.: ``` Found 3 matches for pattern "myFunction" in path "." (filter: "*.ts"): --- @@ -170,7 +105,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the --- ``` - **Confirmation:** No. -- **Confirmation:** No. ## 6. `replace` (Edit) @@ -193,26 +127,6 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - If `old_string` is provided, it reads the `file_path` and attempts to find exactly one occurrence of `old_string`. - If one occurrence is found, it replaces it with `new_string`. - **Enhanced Reliability (Multi-Stage Edit Correction):** To significantly improve the success rate of edits, especially when the model-provided `old_string` might not be perfectly precise, the tool incorporates a multi-stage edit correction mechanism. - - If the initial `old_string` isn't found or matches multiple locations, the tool can leverage the Gemini model to iteratively refine `old_string` (and potentially `new_string`). - - This self-correction process attempts to identify the unique segment the model intended to modify, making the `replace` operation more robust even with slightly imperfect initial context. -- **Failure Conditions:** Despite the correction mechanism, the tool will fail if: - - `file_path` is not absolute or is outside the root directory. - - `old_string` is not empty, but the `file_path` does not exist. - - `old_string` is empty, but the `file_path` already exists. - - `old_string` is not found in the file after attempts to correct it. - - `old_string` is found multiple times, and the self-correction mechanism cannot resolve it to a single, unambiguous match. -- **Output (`llmContent`):** - - On success: `Successfully modified file: /path/to/file.txt (1 replacements).` or `Created new file: /path/to/new_file.txt with provided content.` - - On failure: An error message explaining the reason (e.g., `Failed to edit, 0 occurrences found...`, `Failed to edit, expected 1 occurrences but found 2...`). -- **Confirmation:** Yes. Shows a diff of the proposed changes and asks for user approval before writing to the file. - - `new_string` (string, required): The exact literal text to replace `old_string` with. - - `expected_replacements` (number, optional): The number of occurrences to replace. Defaults to `1`. - -- **Behavior:** - - If `old_string` is empty and `file_path` does not exist, creates a new file with `new_string` as content. - - If `old_string` is provided, it reads the `file_path` and attempts to find exactly one occurrence of `old_string`. - - If one occurrence is found, it replaces it with `new_string`. - - **Enhanced Reliability (Multi-Stage Edit Correction):** To significantly improve the success rate of edits, especially when the model-provided `old_string` might not be perfectly precise, the tool incorporates a multi-stage edit correction mechanism. - If the initial `old_string` isn't found or matches multiple locations, the tool can leverage the Gemini model to iteratively refine `old_string` (and potentially `new_string`). - This self-correction process attempts to identify the unique segment the model intended to modify, making the `replace` operation more robust even with slightly imperfect initial context. - **Failure conditions:** Despite the correction mechanism, the tool will fail if: |
