Skip to main content
The Google Drive resource exposes a Google Drive account as a virtual filesystem mounted at some prefix such as /gdrive/. For Google OAuth setup, see Google Workspace Setup.

Config

Filesystem Layout

Example:
The mount mirrors the actual Google Drive folder hierarchy. The root of the mount corresponds to the Drive API root folder. Subfolders appear as directories, and regular files keep their original names.

Synthetic Extensions

Google Workspace files cannot be downloaded as raw bytes, so they are exposed with synthetic extensions and read via their respective APIs: Regular files (PDFs, images, CSVs, etc.) are downloaded directly from Drive. Large regular files use streaming.

Cache

The Google Drive resource uses IndexCacheStore (same as Slack, Gmail, and other resources). Index entries store folder IDs, file IDs, and file metadata. There is no separate content cache — file content caching is handled by the workspace IOResult mechanism.

Example

See examples/google/gdrive.py for the full working example.

Shell Commands

Standard commands available on the mounted Google Drive tree:

Data Format Support

Google Drive may contain data files in binary columnar formats. These are auto-converted to CSV on read. Specialized variants of common commands handle them natively: Example:

Resource-Specific Commands

Google Drive registers Google Workspace write commands so that Google-native files can be created and updated from the Drive mount.

gws-docs-documents-create

Create a new Google Doc.
Returns the created document JSON.

gws-docs-documents-batchUpdate

Apply batch updates to a Google Doc.
Returns the batch update response JSON.

gws-docs-write

Append text to a Google Doc.
Returns the update response JSON.

gws-sheets-read

Read values from a spreadsheet range.
Returns the range values.

gws-sheets-write

Write values to a spreadsheet range.
Returns the update response JSON.

gws-sheets-append

Append rows to a spreadsheet.
One of --values or --json-values is required. Returns the append response JSON.

gws-sheets-spreadsheets-create

Create a new spreadsheet.
Returns the created spreadsheet JSON.

gws-sheets-spreadsheets-batchUpdate

Apply batch updates to a spreadsheet.
Returns the batch update response JSON.

gws-slides-presentations-create

Create a new Google Slides presentation.
Returns the created presentation JSON.

gws-slides-presentations-batchUpdate

Apply batch updates to a presentation.
Returns the batch update response JSON.