Skip to main content
OneDriveVFS exposes one Microsoft Graph drive as a read-write filesystem. It uses the same browser-safe core in the Node and browser packages.
Use @struktoai/mirage-browser for the same API in a browser. An access-token callback is recommended so a 401 can refresh the token and retry once. Fields marked secret are redacted in snapshots. driveId, siteId, groupId and userId are four ways of saying which drive the mount is, so set at most one: setting two throws at construction rather than silently addressing whichever came first. Setting none means /me/drive, which is the only form an app-only token cannot use. Mounts address https://graph.microsoft.com/v1.0 unless graphBaseUrl says otherwise. Set it to reach anything else: a sovereign cloud, a private endpoint, or a test server, given in full including the version segment. The sovereign deployments are network-isolated instances rather than regions, so a token minted for one is rejected by the others and a mount pointed at the wrong root fails outright. mirage ships no table of their hostnames, having no way to verify one; take the root from Microsoft’s national cloud documentation for your tenant.

VFS.md

The VFS.md an agent reads with OneDrive 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 to list every command, and man <cmd> or <cmd> --help for one command’s usage.

Integration

What OneDrive answers through its own API, so fewer files are read. Integration explains each command. The Python OneDrive docs list when each search answers and what it can miss.