Skip to main content
A Space repository becomes its file tree: the app code, README, Dockerfile and requirements, at one revision.

Setup

Note the Space’s full namespace/space-name from its URL on huggingface.co/spaces. A public Space needs no token. For a private one, create a token at Access Tokens with New token: a Read token, or a Fine-grained one with read access to that Space’s repository.

Connect

workspace.yaml

Layout

  • The tree mirrors the repository at revision, main when unset.
  • Add token: ${HF_TOKEN} to the YAML config for a private Space.
  • In TypeScript the class ships in @struktoai/mirage-node, not @struktoai/mirage-browser.

Sample runs

The mount is read-only: a Hub write is a commit, so echo >, rm, cp and mv are refused. Download, edit and upload as one commit with the hf CLI.

SDK guides

Python

Every config field, the VFS.md and write support.

TypeScript

Every config field, the VFS.md and write support.