Setup
A public repository needs no setup: leave outtoken and the mount reads it
anonymously, as in Public repositories. For a private
repository, create a fine-grained personal access token with read-only
Contents on the repository, then export it:
Create the token
Create the token
- Open Fine-grained tokens (Settings, Developer settings, Personal access tokens, Fine-grained tokens) and click Generate new token.
- Pick the resource owner that holds the repository, then under Repository access choose Only select repositories and pick it.
- Under Permissions, set Contents to Read-only.
- Click Generate token and copy it. An organization that requires approval keeps the token pending until an admin approves it.
repo scope for
private repositories. That broad scope includes write access, so prefer a
fine-grained token for tighter permissions.Connect
- YAML
- Python
- TypeScript
workspace.yaml
Layout
- The tree mirrors the repository at
ref; unsetreffollows the default branch. statshows each file’s git blob SHA.- A GitHub App installation can replace the token; the SDK guides show the
appblock.
Public repositories
With neithertoken nor app, the mount reads a public repository with no
credentials, which is how a browser page mounts one with nothing typed:
workspace.yaml
- File reads come from
raw.githubusercontent.comat the commit the tree listing named, so a read never sees a newer revision than the listing and does not count against the REST API’s rate limit. grep -rwandrg -wread every file instead of asking GitHub code search, which takes no anonymous requests.- The tree listing, and the default branch lookup when
refis unset, still cost REST requests, and GitHub allows 60 an hour per IP address without credentials. A token raises that to 5,000. - On GitHub Enterprise (
base_urlset), anonymous reads go through the REST API, one request per file.
Sample runs
gh CLI, which takes the same token and, unlike the
mount, always needs one.
SDK guides
Python
Every config field, the VFS.md and write support.
TypeScript
Every config field, the VFS.md and write support.