Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

GitHubResource exposes a single repository at a ref as a read-only filesystem. Reads stream blobs through the GitHub API. Setup steps for the personal access token live at GitHub Credentials.

Node

pnpm add @struktoai/mirage-node
import { GitHubResource, MountMode, Workspace } from '@struktoai/mirage-node'

const gh = new GitHubResource({
  token: process.env.GITHUB_TOKEN!,
  owner: 'strukto-ai',
  repo: 'mirage',
  ref: 'main',
})

const ws = new Workspace({ '/repo': gh }, { mode: MountMode.READ })
await ws.execute('cat /repo/README.md')

Browser

pnpm add @struktoai/mirage-browser
import { GitHubResource, MountMode, Workspace } from '@struktoai/mirage-browser'

const gh = new GitHubResource({
  token: GITHUB_TOKEN,
  owner: 'strukto-ai',
  repo: 'mirage',
})
The token reaches the browser, so use a fine-grained PAT scoped to read-only access on a single repo.

Config

FieldDefaultNotes
tokenrequiredPersonal access token. Redacted in snapshots.
ownerrequiredRepo owner (user or org).
reporequiredRepo name.
refHEADBranch, tag, or commit SHA.
baseUrlhttps://api.github.comOverride for GitHub Enterprise.

Mount mode

read. Writes are not yet exposed. For the mounted layout (refs, paths, blob caching) see the Python GitHub docs.