GitHub (read-only): get file contents
github_readonly.get_file_contentsRead a file, or list a directory, from a GitHub repository at a branch, tag or commit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Git commit SHA, branch name, or tag (defaults to repository default branch). | |
| sha | No | Accepts optional commit SHA. If specified, it will be used instead of ref | |
| path | No | Relative path to file or directory in the repository (e.g. 'src/main.py'). | / |
| repo | Yes | Target repository name. | |
| owner | Yes | Repository owner or organization name. | |
| fields | No | Subset of fields to return for each entry when the path is a directory. If omitted, all fields are returned. Ignored when the path is a single file. Use this to reduce response size when listing directories and you only need specific fields, e.g. just 'name' and 'type'. |