files
Read, list, or write files in a repository. Write actions (create, update, delete) each produce a commit. Use 'read' for file content (plain text by default; set with_metadata=true for the SHA needed by update/delete). Use 'list' for a single directory level, 'tree' for a recursive file listing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA. Required for read/list/tree | |
| sha | No | File SHA from a prior read with with_metadata=true. Required for update/delete | |
| page | No | Page number (1-based). For tree | |
| path | No | File or directory path. Required for read, list (empty string for root), create, update, delete | |
| repo | Yes | Repository name | |
| limit | No | Page size. For tree | |
| owner | Yes | Repository owner | |
| action | Yes | Operation to perform | |
| content | No | File content (plain text, base64-encoded automatically). Required for create/update | |
| message | No | Commit message. Required for create/update/delete | |
| end_line | No | Last line to return (1-indexed). For read | |
| recursive | No | Return complete file tree. For tree | |
| start_line | No | First line to return (1-indexed). For read | |
| branch_name | No | Target branch. Required for create/update/delete | |
| with_metadata | No | Return full metadata (SHA, encoding, links) instead of plain text. For read | |
| new_branch_name | No | Create a new branch from branch_name and commit there |