界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

google-drive

google-drive

【效率与协作】Manage Google Drive files and folders. Upload, download, share, and organize files via Drive API.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: google-drive description: Manage Google Drive files and folders. Upload, download, share, and organize files via Drive API. metadata: {"clawdbot":{"emoji":"📁","requires":{"env":["GOOGLE_ACCESS_TOKEN"]}}}

Google Drive

Cloud file storage and sharing.

Environment

export GOOGLE_ACCESS_TOKEN="ya29.xxxxxxxxxx"

List Files

curl "https://www.googleapis.com/drive/v3/files?pageSize=20" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN"

Search Files

curl "https://www.googleapis.com/drive/v3/files?q=name%20contains%20'report'" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN"

Get File Metadata

curl "https://www.googleapis.com/drive/v3/files/{fileId}?fields=*" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN"

Download File

curl "https://www.googleapis.com/drive/v3/files/{fileId}?alt=media" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -o downloaded_file.pdf

Upload File

curl -X POST "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -F "metadata={\"name\": \"myfile.txt\"};type=application/json" \
  -F "file=@localfile.txt"

Create Folder

curl -X POST "https://www.googleapis.com/drive/v3/files" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "New Folder", "mimeType": "application/vnd.google-apps.folder"}'

Share File

curl -X POST "https://www.googleapis.com/drive/v3/files/{fileId}/permissions" \
  -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"role": "reader", "type": "user", "emailAddress": "user@example.com"}'

Links

我的收藏