/gdrive/.
For Google OAuth setup, see Google Workspace Setup.
Config
Filesystem Layout
root folder plus each Shared Drive visible to
the user. Shared Drives appear as top-level directories. Duplicate names
receive a [Shared Drive] suffix and, when needed, a numeric suffix.
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:| Extension | Type | Read via |
|---|---|---|
.gdoc.json | Google Docs | Docs API |
.gsheet.json | Google Sheets | Sheets API |
.gslide.json | Google Slides | Slides API |
Cache
The Google Drive resource usesIndexCacheStore (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
examples/google/gdrive.py for the full working example.
Shell Commands
Standard commands available on the mounted Google Drive tree:| Command | Notes |
|---|---|
ls | List folders and files |
cat | Read file content (regular or Workspace) |
head / tail | First/last N lines or bytes |
grep / rg | Pattern search (file or directory level) |
jq | Query JSON fields on Workspace files |
wc | Line/word/byte counts |
stat | File metadata (name, size, type) |
find | Recursive search with -name, -maxdepth |
tree | Directory tree view |
basename | Extract filename from path |
dirname | Extract directory from path |
realpath | Resolve path to absolute form |
nl | Number lines of output |
sort | Sort lines |
uniq | Deduplicate adjacent lines |
cut | Extract fields/columns |
awk | Pattern-directed scanning |
sed | Stream editor |
tr | Translate/delete characters |
diff | Compare two files |
rev | Reverse lines |
tac | Reverse file line order |
paste | Merge lines of files |
join | Join lines on a common field |
column | Columnate output |
comm | Compare sorted files line by line |
fold | Wrap lines to a given width |
fmt | Reformat paragraph text |
expand | Convert tabs to spaces |
unexpand | Convert spaces to tabs |
du | Estimate file space usage |
shuf | Randomly permute lines |
look | Display lines beginning with a prefix |
strings | Extract printable strings from binary |
base64 | Base64 encode/decode |
md5 | MD5 checksum |
sha256sum | SHA-256 checksum |
xxd | Hex dump |
zcat | Read compressed files |
zgrep | Search compressed files |
readlink | Print resolved symbolic links |
cmp | Compare two files byte by byte |
tsort | Topological sort |
file | Detect file type |
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:| Format | Extension | Specialized commands |
|---|---|---|
| Parquet | .parquet | cat-parquet, head-parquet, tail-parquet, wc-parquet, stat-parquet, grep-parquet, cut-parquet, ls-parquet, file-parquet |
| Feather | .feather | cat-feather, head-feather, tail-feather, wc-feather, stat-feather, grep-feather, cut-feather, ls-feather, file-feather |
| HDF5 | .hdf5 | cat-hdf5, head-hdf5, tail-hdf5, wc-hdf5, stat-hdf5, grep-hdf5, cut-hdf5, ls-hdf5, file-hdf5 |
| ORC | .orc | cat-orc, head-orc, tail-orc, wc-orc, stat-orc, grep-orc, cut-orc, ls-orc, file-orc |
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.
| Option | Required | Description |
|---|---|---|
--json | yes | JSON body with title field |
gws-docs-documents-batchUpdate
Apply batch updates to a Google Doc.
| Option | Required | Description |
|---|---|---|
--params | yes | JSON with documentId |
--json | yes | JSON body with requests array |
gws-docs-write
Append text to a Google Doc.
| Option | Required | Description |
|---|---|---|
--document | yes | Google Doc ID |
--text | yes | Text to append |
gws-sheets-read
Read values from a spreadsheet range.
| Option | Required | Description |
|---|---|---|
--spreadsheet | yes | Spreadsheet ID |
--range | yes | A1 notation range |
gws-sheets-write
Write values to a spreadsheet range.
| Option | Required | Description |
|---|---|---|
--params | yes | JSON with spreadsheetId, range, optional valueInputOption |
--json | yes | JSON body with values array |
gws-sheets-append
Append rows to a spreadsheet.
| Option | Required | Description |
|---|---|---|
--spreadsheet | yes | Spreadsheet ID |
--range | no | A1 notation range (defaults to A1) |
--values | no | Comma-separated values for a single row |
--json-values | no | JSON array of rows (alternative to --values) |
--values or --json-values is required. Returns the
append response JSON.
gws-sheets-spreadsheets-create
Create a new spreadsheet.
| Option | Required | Description |
|---|---|---|
--json | yes | JSON body with properties.title |
gws-sheets-spreadsheets-batchUpdate
Apply batch updates to a spreadsheet.
| Option | Required | Description |
|---|---|---|
--params | yes | JSON with spreadsheetId |
--json | yes | JSON body with requests array |
gws-slides-presentations-create
Create a new Google Slides presentation.
| Option | Required | Description |
|---|---|---|
--json | yes | JSON body with title field |
gws-slides-presentations-batchUpdate
Apply batch updates to a presentation.
| Option | Required | Description |
|---|---|---|
--params | yes | JSON with presentationId |
--json | yes | JSON body with requests array |