Skip to main content
The GitHub VFS uses GitHub’s REST API to mount a repository as a read-only virtual filesystem. It does not imitate another CLI. 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 full recursive tree is fetched on the first read, not at mount time, so constructing the VFS never blocks on the network. For repos with
100K entries, it falls back to per-directory fetching.

Cache

The GitHub VFS 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.