‹ 首页

google-drive

@sanjay3290 · 收录于 1 周前

Interact with Google Drive - search files, find folders, list contents, download files, upload files, create folders, move, copy, rename, and trash files. Use when user asks to: search Google Drive, find a file/folder, list Drive contents, download or upload files, create folders, move files, or organize Drive content. Lightweight integration with standalone OAuth authentication supporting full read/write access.

适合你,如果经常需要操作 Google Drive 文件

/ 下载安装
google-drive.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add sanjay3290/ai-skills/google-drive
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- sanjay3290/ai-skills/google-drive
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify sanjay3290/ai-skills/google-drive
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
335GitHub stars
~854最小装载
~6.9K含声明引用
~7.6K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · Apache-2.0 · cde1c83

Google Drive

Lightweight Google Drive integration with standalone OAuth authentication. No MCP server required. Full read/write access.

Requires Google Workspace account. Personal Gmail accounts are not supported.
First-Time Setup

Authenticate with Google (opens browser):

python scripts/auth.py login

Check authentication status:

python scripts/auth.py status

Logout when needed:

python scripts/auth.py logout
Read Commands

All operations via scripts/drive.py. Auto-authenticates on first use if not logged in.

# Search for files (full-text search)
python scripts/drive.py search "quarterly report"

# Search by title only
python scripts/drive.py search "title:budget"

# Search using Google Drive URL (extracts ID automatically)
python scripts/drive.py search "https://drive.google.com/drive/folders/1ABC123..."

# Search files shared with you
python scripts/drive.py search --shared-with-me

# Search with pagination
python scripts/drive.py search "report" --limit 5 --page-token "..."

# Find a folder by exact name
python scripts/drive.py find-folder "Project Documents"

# List files in root Drive
python scripts/drive.py list

# List files in a specific folder
python scripts/drive.py list 1ABC123xyz --limit 20

# Download a file
python scripts/drive.py download 1ABC123xyz ./downloads/report.pdf
Write Commands
# Upload a file to Drive root
python scripts/drive.py upload ~/Documents/report.pdf

# Upload to a specific folder
python scripts/drive.py upload ~/Documents/report.pdf --folder 1ABC123xyz

# Upload with a custom name
python scripts/drive.py upload ~/Documents/report.pdf --name "Q4 Report.pdf"

# Create a new folder
python scripts/drive.py create-folder "Project Documents"

# Create a folder inside another folder
python scripts/drive.py create-folder "Attachments" --parent 1ABC123xyz

# Move a file to a different folder
python scripts/drive.py move FILE_ID DESTINATION_FOLDER_ID

# Copy a file
python scripts/drive.py copy FILE_ID
python scripts/drive.py copy FILE_ID --name "Report Copy" --folder 1ABC123xyz

# Rename a file or folder
python scripts/drive.py rename FILE_ID "New Name.pdf"

# Move a file to trash
python scripts/drive.py trash FILE_ID
Search Query Formats

The search command supports multiple query formats:

| Format | Example | Description | |--------|---------|-------------| | Full-text | "quarterly report" | Searches file contents and names | | Title | "title:budget" | Searches file names only | | URL | https://drive.google.com/... | Extracts and uses file/folder ID | | Folder ID | 1ABC123... | Lists folder contents (25+ char IDs) | | Native query | mimeType='application/pdf' | Pass-through Drive query syntax |

File ID Format

Google Drive uses long IDs like 1ABC123xyz_-abc123. Get IDs from:

  • search results
  • find-folder results
  • list results
  • Google Drive URLs
Download Limitations
  • Regular files (PDFs, images, etc.) download directly
  • Google Docs/Sheets/Slides cannot be downloaded via this tool
  • For Google Workspace files, use export or dedicated tools
Token Management

Tokens stored securely using the system keyring:

  • macOS: Keychain
  • Windows: Windows Credential Locker
  • Linux: Secret Service API (GNOME Keyring, KDE Wallet, etc.)

Service name: google-drive-skill-oauth

Automatically refreshes expired tokens using Google's cloud function.

按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。