git-files
Read, search, list, and backup files from Git repositories without modifying content. Supports local and remote repositories including GitHub and Gitea for secure file management operations.
Instructions
Read-only file management tool for repository files. Supports reading, searching, listing, and backup operations for both local and remote repositories. File content modification operations are not allowed for security reasons.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | The file operation to perform. Only read-only operations are supported. | |
backupPath | No | Path for backup (optional for backup operation - will auto-generate if not provided) | |
branch | No | Target branch for remote read operations | |
caseSensitive | No | Case sensitive search (default: false) | |
encoding | No | Content encoding for read operations (default: utf8) | |
excludePattern | No | Pattern for files to exclude from backup | |
filePath | No | Relative path to the file within the repository (required for read operation) | |
filePattern | No | File pattern for search (e.g., "*.js") | |
includePattern | No | Pattern for files to include in backup | |
owner | No | Repository owner (for remote operations) | |
projectPath | Yes | Absolute path to the project directory (required for all operations) | |
provider | No | Provider for remote operations (optional for local operations) | |
query | No | Search query (required for search operation) | |
repo | No | Repository name (for remote operations) |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "The file operation to perform. Only read-only operations are supported.",
"enum": [
"read",
"search",
"backup",
"list"
],
"type": "string"
},
"backupPath": {
"description": "Path for backup (optional for backup operation - will auto-generate if not provided)",
"type": "string"
},
"branch": {
"description": "Target branch for remote read operations",
"type": "string"
},
"caseSensitive": {
"description": "Case sensitive search (default: false)",
"type": "boolean"
},
"encoding": {
"description": "Content encoding for read operations (default: utf8)",
"enum": [
"utf8",
"base64",
"binary"
],
"type": "string"
},
"excludePattern": {
"description": "Pattern for files to exclude from backup",
"type": "string"
},
"filePath": {
"description": "Relative path to the file within the repository (required for read operation)",
"type": "string"
},
"filePattern": {
"description": "File pattern for search (e.g., \"*.js\")",
"type": "string"
},
"includePattern": {
"description": "Pattern for files to include in backup",
"type": "string"
},
"owner": {
"description": "Repository owner (for remote operations)",
"type": "string"
},
"projectPath": {
"description": "Absolute path to the project directory (required for all operations)",
"type": "string"
},
"provider": {
"description": "Provider for remote operations (optional for local operations)",
"enum": [
"github",
"gitea",
"both"
],
"type": "string"
},
"query": {
"description": "Search query (required for search operation)",
"type": "string"
},
"repo": {
"description": "Repository name (for remote operations)",
"type": "string"
}
},
"required": [
"action",
"projectPath"
],
"type": "object"
}