Skip to main content
GDocsVFS exposes Google Docs as .gdoc.json files. Reads return the document’s structured content. Setup steps for OAuth credentials live at Google Workspace Credentials.

Node

Browser

A PKCE example lives at examples/browser/vfs/gdocs/gdocs_pkce.ts.

Config

Fields marked secret are redacted in snapshots.

Mount mode

read. A MountMode.WRITE mount also allows mv (retitle) and rm (delete). Append text with the gws CLI. For the JSON shape see the Python Google Docs docs.

VFS.md

The VFS.md an agent reads with Google Docs 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.
  • <doc-id> is the Google Docs document id.
  • shared/ holds docs shared with you by others; ones you own and shared with others are still in owned/.
A .gdoc.json holds the Google Docs API documents.get response, read with includeTabsContent=true so every tab is present:
There is no top-level .body. A tab-aware response leaves the singleton fields (.body, .documentStyle, .namedStyles) empty and hangs every tab’s content off .tabs[].documentTab instead. Tabs also nest, so text can sit at any depth under .childTabs; the recursive recipes below read a one-tab and a fifty-tab document alike.Useful jq paths:
The first block of a body is always a sectionBreak, which carries no .paragraph, so a path through .paragraph needs the ? or it fails with Cannot iterate over null.Delete, on a write path:
Only .gdoc.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.

Integration

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