Gws drive

From vorojar/AgentClaw · View interactive version

Gws drive is an AI agent skill from the GitHub repository vorojar/AgentClaw. Google Drive 文件:搜索/上传/下载/共享。不用于:本地文件操作、其他云盘

How to use this skill

Skill file

Requires: gws CLI installed and authenticated (gws auth login).

Command syntax

gws drive <resource> <method> --params '{"key":"val"}' --json '{"key":"val"}'

Search files

{"command": "gws drive files list --params '{\"q\":\"name contains '\\''report'\\'' and mimeType != '\\''application/vnd.google-apps.folder'\\'''\",\"fields\":\"files(id,name,mimeType,modifiedTime,size)\",\"pageSize\":20}'", "timeout": 30000}

Common query operators: name contains 'x', mimeType = 'application/pdf', trashed = false, 'FOLDER_ID' in parents, modifiedTime > '2026-03-01T00:00:00'.

List files in a folder

{"command": "gws drive files list --params '{\"q\":\"'\\''FOLDER_ID'\\'' in parents and trashed = false\",\"fields\":\"files(id,name,mimeType,modifiedTime,size)\"}'", "timeout": 30000}

Download file

{"command": "gws drive files get --params '{\"fileId\":\"FILE_ID\",\"alt\":\"media\"}' --output 'data/tmp/filename.pdf'", "timeout": 60000}

Upload file

{"command": "gws drive files create --json '{\"name\":\"report.pdf\",\"parents\":[\"FOLDER_ID\"]}' --upload 'data/tmp/report.pdf'", "timeout": 60000}

Create folder

{"command": "gws drive files create --json '{\"name\":\"New Folder\",\"mimeType\":\"application/vnd.google-apps.folder\",\"parents\":[\"PARENT_FOLDER_ID\"]}'", "timeout": 30000}

Share file (add permission)

{"command": "gws drive permissions create --params '{\"fileId\":\"FILE_ID\"}' --json '{\"role\":\"reader\",\"type\":\"user\",\"emailAddress\":\"alice@example.com\"}'", "timeout": 30000}

Roles: reader, writer, commenter, owner.

Delete file (trash)

{"command": "gws drive files update --params '{\"fileId\":\"FILE_ID\"}' --json '{\"trashed\":true}'", "timeout": 30000}

Get file metadata

{"command": "gws drive files get --params '{\"fileId\":\"FILE_ID\",\"fields\":\"id,name,mimeType,size,modifiedTime,webViewLink\"}'", "timeout": 30000}

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.