Skip to main content
The HF Spaces VFS mounts a Hugging Face Space repo (app code, README, config, requirements) at some prefix such as /s/. For credential setup, see HF Spaces Setup.

Install

Config

Fields marked secret are redacted in snapshots.

Reading, not writing

This mount is read-only, the way a github mount is. A Hub write is a commit, and a POSIX write cannot say where a commit ends, so echo >, rm, cp and mv are refused here rather than silently making one commit per file. The hf CLI is the write half: hf download --local-dir puts a copy on a ram or disk mount, which is an ordinary writable filesystem, and hf upload sends it back as a single commit.

Listings under fresh

Under read: fresh, a cached listing is checked against the commit the revision resolves to: one small check per command (revision/{rev}?expand[]=sha), after which every cached listing of the mount at that commit is served. A mount whose revision is a full 40- or 64-hex commit sha is checked the same way, with that one small request per command: a branch or tag named like the sha could take the name, and mirage does not assume which one the Hub resolves. With a key_prefix, the stored version is that commit joined with the prefix, so mounts of different subtrees sharing an index never share a version.

VFS.md

The VFS.md an agent reads with HF Spaces mounted at /<path>.

Virtual Filesystem

Supported Unix Commands for VFS

Unix commands work on each path as on a local filesystem, as far as the path supports them:

Limitations of Unix Commands for VFS

Where a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.
For example, HuggingFaceBio/carbon-demo mounted at /s/ might expose:

Integration

What Hugging Face Spaces answers through its own API, so fewer files are read. Integration explains each command.

Example

Shell Commands

Every read command in HF Buckets’ set works here, as do the text processing and path utilities, which only read. What does not is the File Operations group: this mount is read-only, so rm and touch are refused, as is any command asked to write into it.

Use Cases

  • Space introspection: Browse an app’s structure, requirements, and config before forking/cloning
  • App code review: grep / find across a Space’s Python without cloning the repo