Skip to main content
The GitHub resource mounts a GitHub repository as a read-only virtual filesystem. For token setup, see GitHub Setup.

Config

Filesystem Layout

The filesystem mirrors the repository tree. No owner/repo/branch in the path - those are specified at mount time.

Tree Fetching

The resource fetches the full recursive tree at init. For repos with
100K entries, it falls back to per-directory fetching.

Cache

The GitHub resource uses IndexCacheStore with SHA-based fingerprinting. Content is content-addressed - if the SHA matches, the content is identical.

Example

See examples/code/github.py for the full working example.

Finding SHAs

Git blob SHAs are available via the stat command:

Working with Large Repos

Tips for efficient access on large repositories:

Shell Commands

Standard commands available on the mounted GitHub tree:

Search Optimization

rg uses the GitHub code search API when the search scope exceeds 100 files and the mounted ref is the repository’s default branch. This avoids downloading file contents and returns results significantly faster for large repositories.