Read a file from GitHub
github_get_fileFetch text file contents from a GitHub repository branch or commit. Returns content, SHA, size, and file URL, with offset-based pagination for large files.
Instructions
Read a text file from a repository branch. Returns content, sha, size and the file's URL. Files of any size are readable (the blob API is used past GitHub's 1 MB contents limit), but only maxBytes are returned per call: page through a large content bundle with the nextOffset of a truncated reply, or change it in place with github_commit_files edits instead of reading it whole. Binary files are refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or commit; defaults to the default branch. | |
| path | Yes | Path inside the repository, e.g. 'src/pages/index.astro'. | |
| repo | Yes | Repository as 'owner/name', e.g. 'octocat/my-site'. | |
| offset | No | Byte offset to start at (use the nextOffset of a truncated reply). Never splits a UTF-8 character. | |
| maxBytes | No | Most bytes of file content to return in one call, so a huge file cannot flood the answer. Above ~100 KB the server's own result cap may trim the reply further. |