No slash command · from duckdb-gdrive
Reads and writes files in Google Drive via DuckDB's gdrive extension: paths, browser addresses, Sheets/Docs as CSV/text, COPY TO, write_blob, ATTACH, and DuckLake on Drive.
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.
Paths are relative to the secret's root (DRIVE_ID / ROOT_FOLDER_ID, else My Drive):
SELECT * FROM 'gdrive://Finance/2026/actuals.parquet'; -- one files.list per path segment
SELECT * FROM read_csv('gdrive://id:1a2b3c...'); -- by file id: no resolution at all
SELECT * FROM read_parquet('gdrive://exports/**/part-[0-9]*.parquet');
COPY (SELECT * FROM t) TO 'gdrive://reports/out.parquet' (FORMAT parquet); -- streamed, appears on close
SELECT write_blob('gdrive://notes/a.md', encode('# Hi')); -- remove_file / move_file / file_size too
ATTACH 'gdrive://warehouse/sales.duckdb' AS s (READ_ONLY); -- read-only, GLOBAL settings only
a/b/c.csv costs three lookups (cached per secret).
Generated or repeated queries should use gdrive://id:<fileId>.id: form. A glob returns such files as gdrive://id: paths.The address bar or "Copy link" works wherever a path does -- it names the file by id:
SELECT * FROM read_csv('https://drive.google.com/file/d/1a2b3c.../view?usp=sharing');
SELECT * FROM read_csv('https://docs.google.com/spreadsheets/d/1x2y3z.../edit#gid=0'); -- a Sheet
SELECT * FROM read_gdrive_files('https://drive.google.com/drive/folders/1f2g3h...'); -- a folder
COPY t TO 'https://drive.google.com/file/d/1a2b3c.../view' (FORMAT csv); -- overwrites that file
Handled by this extension even with httpfs loaded (so it acts with the runner's secret).
?...&version=<id> in an address reads that version. Folder addresses work in the metadata
functions only, and nothing may follow the folder id. Writes need /file/d/<id>/view (or
gdrive://id:<id>); bare /file/d/<id>, open?id= and editor addresses are refused.
web_url from read_gdrive_files reads back.
They have no bytes, so they are exported once per open: Sheets as CSV (the first tab;
any tab or range, typed, and writing into a Sheet: the gdrive-sheets skill),
Docs as text/plain (SET gdrive_docs_export_mime = 'text/markdown'). Not cached across
queries -- materialise a Sheet you query repeatedly:
CREATE TABLE budget AS SELECT * FROM read_csv('gdrive://Finance/Budget');
gdrive_upload_chunk_bytes,
16 MiB); positional writes and appends are refused. A failed COPY publishes nothing.Report.csv and report.csv are two files). A write never
replaces a folder or a native Doc/Sheet; a trashed file is gone by path and by id.SET gdrive_permanent_delete = true to delete outright). write_blob updates in place
(same id, a new revision -- see gdrive-metadata's versions)..duckdb on Drive.Keep the catalog local, put only the data on Drive:
ATTACH 'ducklake:metadata.db' AS lake (DATA_PATH 'gdrive://lakehouse/');
SET gdrive_immutable_prefixes = 'gdrive://lakehouse'; -- skips a metadata call per file per query
gdrive_immutable_prefixes is a promise the files are never modified, replaced or
recreated in place; wrong, it causes stale reads nothing can detect.
A ranged read costs ~1 s regardless of size, so reads go through a shared block cache
(gdrive_block_size_bytes, 16 MiB). A cold Parquet scan is about 3x object storage;
lookups, not bytes, dominate. CALL gdrive_reset_stats(); <query>; SELECT * FROM gdrive_stats();
shows the calls one query made.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/gdrive-metadataGoogle Drive's metadata as tables with the gdrive DuckDB extension: read_gdrive_files (files under a path, glob or folder with owner, last modifier, size, md5, web_url, revision, custom properties, lock), search_gdrive (Drive's full-text search; hits read back by id), gdrive_drives (Shared Drives and their ids), gdrive_versions and the ?version= path form (read an earlier revision with any reader), gdrive_changes (what changed under a folder since a token -- the mirror / incremental-sync pattern), and gdrive_permissions (who can reach what: direct, inherited, anyone-with-link, domain). Use when listing or inventorying Drive, finding a file, reading an old version, syncing a folder incrementally, or auditing sharing.
/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.
npx claudepluginhub datazoode/duckdb-gdrive --plugin duckdb-gdriveOther plugins' skills for the same job