No slash command · from duckdb-gdrive
Exposes Google Drive metadata as DuckDB tables: list files with owner, size, MD5, locks; full-text search; read earlier revisions; incremental sync via change tokens; audit permissions.
Ships in duckdb-gdrive. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
New in v2026.11.08 (not in v2026.10.18 or earlier). Every function takes a
gdrive:// path (the scheme may be left out), an id: path or a browser address -- of a
file, not a ?version=; a literal path that names nothing is an error, a glob may match
nothing. Table functions take no subqueries: pass a value through
SET VARIABLE x = (...) and getvariable('x').
SELECT name, size, modified, modified_by, owner_email, web_url
FROM read_gdrive_files('gdrive://Finance/**/*.csv'); -- a glob, a file, or a folder (its files)
Columns: path, name, size, created, modified, modified_by(_email), owner(_email), mime_type, id, web_url, version, md5, description, starred, shared, parent_id, properties
(MAP of Drive's custom properties), then the lock (Drive's content restriction):
locked, locked_by, locked_by_email, locked_at, lock_reason, copy_requires_writer_permission
(locked_by_email is NULL for a service account -- Drive hides it). A glob costs the listings
glob() makes, no call per file. Native Docs/Sheets: size, md5, version are NULL.
A write to a locked file is refused by Drive ("would violate a content restriction").
SELECT path, locked_by, locked_at, lock_reason FROM read_gdrive_files('gdrive://Finance/**') WHERE locked;
SELECT name, path, modified FROM search_gdrive('quarterly forecast');
SELECT name, path FROM search_gdrive('', mime_type := 'application/vnd.google-apps.spreadsheet', max_results := 50);
SET VARIABLE p = (SELECT path FROM search_gdrive('plan 2026') LIMIT 1);
SELECT * FROM read_csv(getvariable('p'));
Full text over names and contents, everything the identity can see (its Shared Drive when
the secret binds DRIVE_ID; ROOT_FOLDER_ID does NOT narrow it). Folders are hits too. path is gdrive://id:<id>; same columns as read_gdrive_files.
SELECT name, id FROM gdrive_drives() (or gdrive_drives(search := 'Fin')) -- id is what
DRIVE_ID takes.
SELECT version, current, modified, modified_by, size, path FROM gdrive_versions('gdrive://f.csv');
SELECT * FROM read_csv('gdrive://f.csv?version=<revision id>'); -- any reader; read-only
Newest first; path reads that version. Uploaded files only: native Docs/Sheets list
revisions but cannot be read at one. Drive prunes old revisions unless keep_forever.
An in-place update (write_blob, USE_TMP_FILE false) makes a revision; COPY's default
tmp-file-and-move makes a new file, with no history.
SELECT token FROM gdrive_changes('gdrive://Finance', token := 'latest'); -- just a token
SELECT * FROM gdrive_changes('gdrive://Finance', token := getvariable('t'));
SELECT * FROM gdrive_changes('gdrive://Finance', token := getvariable('t'), outside := true); -- for a mirror
Rows: _change = upsert | delete | checkpoint (exactly one, last; its token is for
next time), with id, path, name, is_folder, mime_type, size, modified, modified_by(_email).
No token = everything under the folder once. A folder renamed or moved in brings its
subtree (new paths). Trashed or deleted = delete by id (a permanent delete has no path
and is always reported). Moved OUT looks like "never in": only outside := true reports
it (as path-less deletes, a folder with its subtree), and with it every change elsewhere
in the drive -- a mirror needs it, a "what's new here" query does not. Names shared by
siblings or containing '/' get gdrive://id: paths. One row per id. The feed lags writes
by seconds to minutes; a very old token replays everything since. An unknown or expired
token is an error: start over.
Mirror pattern: store the token FIRST, then the listing; each run (with outside := true)
delete the changed ids, insert the non-folder upserts, store the new token (README
"Keeping a mirror"). A removed entry is confirmed with one files.get before it becomes a
delete (an entry without parents too, but only with outside := true); the feed can still
lag, so a mirror that must never lose a file re-lists now and then.
SELECT path, role, granted_by, grantee_type, grantee_email, link_scope, discoverable
FROM gdrive_permissions('gdrive://Shared/**') WHERE granted_by = 'link';
One row per permission: role (owner, organizer, fileOrganizer, writer, commenter, reader),
granted_by = direct | inherited | link; link_scope = anonymous (anyone with the
link) | organization (a domain), discoverable (findable in search), link_url,
inherited_from (Shared Drives), expires. A file or folder, or the files and folders of a
glob (not the glob's root: add it separately); one call per item. A grant
no higher than an inherited one is not recorded by Drive and reads as inherited.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub datazoode/duckdb-gdrive --plugin duckdb-gdrive4 skills in this plugin
/gdrive-filesFiles in Google Drive with the gdrive DuckDB extension: the gdrive:// filesystem (paths relative to the secret's root, the id: form, globs with * ? [a-z] ** {a,b}, duplicate-name errors), browser addresses pasted as paths (drive.google.com/file/d/..., docs.google.com/spreadsheets/d/..., folders), reading Parquet/CSV/JSON/anything through it, native Google Sheets and Docs (exported as CSV / text), COPY TO (streamed, appears on close), write_blob / remove_file / move_file / file_size, ATTACH of a .duckdb file (read-only), DuckLake with DATA_PATH on Drive, and the concurrency limits (no atomic create: concurrent writers duplicate). Use when reading or writing files in Google Drive from SQL, querying a Sheet, putting a lakehouse on Drive, or when the user pastes a Drive or Sheets link.
/gdrive-setupInstalling and authenticating the gdrive DuckDB extension: INSTALL/LOAD, CREATE SECRET (TYPE gdrive) with PROVIDER credential_chain (the default: gcloud Application Default Credentials, GOOGLE_APPLICATION_CREDENTIALS, a service-account key, or a workload identity federation external_account file), service_account (KEY_FILE), authorization_code (browser consent with your own OAuth client), config (ACCESS_TOKEN / REFRESH_TOKEN); DRIVE_ID (a Shared Drive) vs ROOT_FOLDER_ID (a folder), gdrive_drives() to find the id, DRIVE_SCOPE (never SCOPE); the gcloud --scopes trap, the Workspace "This app is blocked" page, why a service account can write only inside a Shared Drive; settings and gdrive_stats(). Use when connecting DuckDB to Google Drive, writing a CREATE SECRET, or fixing a 401/403 or "no secret configured" error.
/gdrive-sheetsGoogle Sheets by tab and A1 range with the gdrive DuckDB extension: read_sheet_range(path, 'Tab!A1:F' [, header, all_varchar]) reads any tab or range, typed (dates, booleans, formula results); COPY ... TO '<Sheet>' (FORMAT sheet_range, RANGE 'Tab!A1' [, HEADER b] [, OVERWRITE | APPEND] [, CREATE b]) writes into a tab in place through the Sheets API (missing tab created, other tabs and formats kept), and creates a new native Sheet when a gdrive:// path names nothing. Covers A1 forms and quoting ('My Tab'!A1), OVERWRITE vs APPEND vs the default block write, atomicity and the 2 MB split, value typing (dates as dates, '=1+1' stays text, LIST refused), the drive scope and SERVICE_DISABLED errors. Use when reading a specific tab or range of a Sheet, writing query results or a forecast into a Sheet, or appending rows to one. (The separate gsheets community extension is a different product with its own functions.)
Other plugins' skills for the same job