Skip to main content
The Google Sheets VFS exposes Sheets spreadsheets as a virtual filesystem mounted at some prefix such as /gsheets/. For Google OAuth setup, see Google Workspace Setup.

Config

Fields marked secret are redacted in snapshots.

VFS.md

The VFS.md an agent reads with Google Sheets mounted at /<path>.

Virtual Filesystem

VFS Layout

/<path>
  • <YYYY-MM-DD> is the file’s modifiedTime, so a date glob such as 2026-05-* narrows by it.
  • <title> is sanitized: spaces and any character outside [A-Za-z0-9_.-] become _, at most 100 characters.
  • <spreadsheet-id> is the Google Sheets spreadsheet id.
  • shared/ holds sheets shared with you by others; ones you own and shared with others are still in owned/.
A .gsheet.json matches the Google Sheets API spreadsheets.get response:
Useful jq paths:
Delete, on a write path:
Only .gsheet.json files can be removed; owned/ and shared/ cannot.Rename to a new title, on a write path:
Keep the folder, the date and the id, and spell the title the way the listing does (spaces become _); any other name is refused.

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.
Spreadsheets are split into owned (spreadsheets you created) and shared (spreadsheets shared with you). The filename shape is:
If the modified date is unavailable, the date prefix is omitted. Reading a spreadsheet file returns the full Google Sheets API JSON for that spreadsheet, including sheet metadata.

Shared Drives

The listing covers every corpus the account can reach, so a spreadsheet that lives in a Shared Drive appears here too. A Shared Drive spreadsheet has no owner (the drive owns it), so it lands under shared, which is what that directory means. This matches the gdrive mount, where Shared Drives are top-level directories: without it the same account would see a spreadsheet under one Google mount and not the other, with no error explaining the difference. Drive answers an all-corpora search best-effort. When it reports that it skipped a corpus, the short listing is still returned but is not cached as the directory, so the next ls re-lists instead of serving the gap until the cache expires.

Cache

The Google Sheets VFS uses IndexCacheStore. Index entries store spreadsheet IDs and metadata. File bytes go through the workspace file cache; a rendered read through FUSE, ws.vfs, a < file redirect or a cross-mount cp, sed or diff is not cached.

Example

See examples/python/vfs/gsheets/gsheets.py for the full working example.

Shell Commands

Standard commands available on the mounted Google Sheets tree:

Integration

What Google Sheets answers through its own API, so fewer files are read. Integration explains each command. grep -rw and rg -w read only the spreadsheets Drive full-text search names; every one is read when the search fails or finds nothing. A word the rendered JSON may hold whatever the text says is never asked: one with a digit, a property name or enum value of the Sheets API (formattedValue, NUMBER), or a word every rendering carries (https, arial). walk_limit: -1 in the mount’s "@all" command limit reads every file instead, since Drive indexes a write some time after it lands and searches the file’s text, so one whose JSON holds the word only in another value (a formula, the time zone, a sheet title, a link or an id) can be left out. Acting on spreadsheets (read/write/append ranges, raw API calls) goes through the gws CLI when installed.