query_files
Read Perforce file data: fetch content, history, metadata, diffs, annotations, or search by name and grep by content. Use read-only queries without modifying depot state.
Instructions
Get file content, history, info, diff, annotations, search by name, grep by content (READ permission)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff2 | No | Use p4 diff2 for depot-to-depot diff, false for mixed diff | |
| file2 | No | Second file path - required for diff action | |
| action | Yes | File query action, metadata includes extra information like optional attributes and file size | |
| ranges | No | Optional line ranges for the content action only. Each inner list is a [start, end] pair, 1-based inclusive. When set, the response carries a 'chunks' array with one entry per range instead of the whole file. | |
| pattern | No | Search or grep pattern - required for search and grep actions | |
| file_path | Yes | Primary file path - required for all actions | |
| max_results | No | Maximum number of results to return. Bounds history/search/grep and also caps fstat info/metadata via 'p4 fstat -m N'. Omit for unbounded info/metadata results. | |
| case_insensitive | No | Case-insensitive matching for grep action |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||