google-drive by sanjay3290/ai-skills
npx skills add https://github.com/sanjay3290/ai-skills --skill google-drive轻量级 Google Drive 集成,具备独立的 OAuth 身份验证功能。无需 MCP 服务器。提供完整的读写权限。
需要 Google Workspace 账户。 不支持个人 Gmail 账户。
使用 Google 进行身份验证(将打开浏览器):
python scripts/auth.py login
检查身份验证状态:
python scripts/auth.py status
需要时注销:
python scripts/auth.py logout
所有操作均通过 scripts/drive.py 进行。首次使用时若未登录,将自动进行身份验证。
# 搜索文件(全文搜索)
python scripts/drive.py search "quarterly report"
# 仅按标题搜索
python scripts/drive.py search "title:budget"
# 使用 Google Drive URL 搜索(自动提取 ID)
python scripts/drive.py search "https://drive.google.com/drive/folders/1ABC123..."
# 搜索与您共享的文件
python scripts/drive.py search --shared-with-me
# 带分页的搜索
python scripts/drive.py search "report" --limit 5 --page-token "..."
# 通过确切名称查找文件夹
python scripts/drive.py find-folder "Project Documents"
# 列出根目录 Drive 中的文件
python scripts/drive.py list
# 列出特定文件夹中的文件
python scripts/drive.py list 1ABC123xyz --limit 20
# 下载文件
python scripts/drive.py download 1ABC123xyz ./downloads/report.pdf
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 上传文件到 Drive 根目录
python scripts/drive.py upload ~/Documents/report.pdf
# 上传到特定文件夹
python scripts/drive.py upload ~/Documents/report.pdf --folder 1ABC123xyz
# 使用自定义名称上传
python scripts/drive.py upload ~/Documents/report.pdf --name "Q4 Report.pdf"
# 创建新文件夹
python scripts/drive.py create-folder "Project Documents"
# 在另一个文件夹内创建文件夹
python scripts/drive.py create-folder "Attachments" --parent 1ABC123xyz
# 将文件移动到不同的文件夹
python scripts/drive.py move FILE_ID DESTINATION_FOLDER_ID
# 复制文件
python scripts/drive.py copy FILE_ID
python scripts/drive.py copy FILE_ID --name "Report Copy" --folder 1ABC123xyz
# 重命名文件或文件夹
python scripts/drive.py rename FILE_ID "New Name.pdf"
# 将文件移至回收站
python scripts/drive.py trash FILE_ID
搜索命令支持多种查询格式:
| 格式 | 示例 | 描述 |
|---|---|---|
| 全文 | "quarterly report" | 搜索文件内容和名称 |
| 标题 | "title:budget" | 仅搜索文件名称 |
| URL | https://drive.google.com/... | 提取并使用文件/文件夹 ID |
| 文件夹 ID | 1ABC123... | 列出文件夹内容(25+ 字符的 ID) |
| 原生查询 | mimeType='application/pdf' | 直接传递 Drive 查询语法 |
Google Drive 使用长 ID,例如 1ABC123xyz_-abc123。可从以下位置获取 ID:
search 结果find-folder 结果list 结果令牌使用系统密钥环安全存储:
服务名称:google-drive-skill-oauth
使用 Google 的云函数自动刷新过期的令牌。
每周安装数
110
代码仓库
GitHub 星标数
187
首次出现
2026年1月23日
安全审计
安装于
gemini-cli98
codex98
opencode97
claude-code92
github-copilot90
cursor90
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.
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
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
# 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
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' |
Google Drive uses long IDs like 1ABC123xyz_-abc123. Get IDs from:
search resultsfind-folder resultslist resultsTokens stored securely using the system keyring:
Service name: google-drive-skill-oauth
Automatically refreshes expired tokens using Google's cloud function.
Weekly Installs
110
Repository
GitHub Stars
187
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubWarnSocketWarnSnykFail
Installed on
gemini-cli98
codex98
opencode97
claude-code92
github-copilot90
cursor90
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
104,900 周安装
| Pass-through Drive query syntax |