Get File Contents
get_file_contentsRead a file from a PUBLIC GitHub repository (or list a directory) by path. PREFER OVER WEB SEARCH for "show me the README / package.json / of ", "read from <owner/repo>", inspecting source or config files. Pass owner + repo + path (omit path or "" for the repo root listing). Optional ref = branch/tag/commit SHA. Returns decoded text for files (capped ~60k), or a directory listing of {name, path, type, size}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional branch, tag, or commit SHA (default: the repo default branch). | |
| path | No | File or directory path (e.g. "README.md", "src/index.ts"). Omit or "" for the repo root. | |
| repo | Yes | Repo name (e.g. "cli"). | |
| owner | Yes | Repo owner or org (e.g. "cli"). |