google-drive by odyssey4me/agent-skills
npx skills add https://github.com/odyssey4me/agent-skills --skill google-drive与 Google Drive 交互,进行文件管理、搜索和分享。
依赖项:pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml
安装后,验证技能是否已正确配置:
$SKILL_DIR/scripts/google-drive.py check
这将检查:
如果缺少任何内容,检查命令将提供设置说明。
Google Drive 使用 OAuth 2.0 进行身份验证。完整的设置说明,请参阅:
创建 ~/.config/agent-skills/google.yaml:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
oauth_client: client_id: your-client-id.apps.googleusercontent.com client_secret: your-client-secret
运行 $SKILL_DIR/scripts/google-drive.py check 以触发 OAuth 流程并验证设置。
遇到范围或身份验证错误时,请参阅 OAuth 故障排除指南。
有关每个命令的读/写分类,请参阅 permissions.md。
# 设置和身份验证
$SKILL_DIR/scripts/google-drive.py check
$SKILL_DIR/scripts/google-drive.py auth setup --client-id ID --client-secret SECRET
$SKILL_DIR/scripts/google-drive.py auth reset
$SKILL_DIR/scripts/google-drive.py auth status
# 文件
$SKILL_DIR/scripts/google-drive.py files list [--query QUERY] [--max-results N] [--order-by FIELD]
$SKILL_DIR/scripts/google-drive.py files search [--name NAME] [--mime-type TYPE] [--folder ID]
$SKILL_DIR/scripts/google-drive.py files get FILE_ID
$SKILL_DIR/scripts/google-drive.py files download FILE_ID --output PATH
$SKILL_DIR/scripts/google-drive.py files upload PATH [--parent ID] [--name NAME] [--mime-type TYPE] [--convert-to MIME_TYPE]
$SKILL_DIR/scripts/google-drive.py files move FILE_ID --parent FOLDER_ID
$SKILL_DIR/scripts/google-drive.py files delete FILE_ID
$SKILL_DIR/scripts/google-drive.py files rename FILE_ID --name NAME
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID [--name NAME] [--parent ID]
# 文件夹
$SKILL_DIR/scripts/google-drive.py folders create NAME [--parent ID]
$SKILL_DIR/scripts/google-drive.py folders list FOLDER_ID [--max-results N]
# 共享和权限
$SKILL_DIR/scripts/google-drive.py share FILE_ID --email EMAIL [--role ROLE] [--no-notify]
$SKILL_DIR/scripts/google-drive.py permissions list FILE_ID
$SKILL_DIR/scripts/google-drive.py permissions delete FILE_ID PERMISSION_ID
完整参数详情和示例,请参阅 command-reference.md。
$SKILL_DIR/scripts/google-drive.py check
$SKILL_DIR/scripts/google-drive.py files list --query "mimeType='application/pdf'" --max-results 5
$SKILL_DIR/scripts/google-drive.py files search --name "project proposal"
# 首先,找到文件 ID
$SKILL_DIR/scripts/google-drive.py files search --name "report.pdf"
# 然后下载它
$SKILL_DIR/scripts/google-drive.py files download FILE_ID -o ./report.pdf
# 上传文件
$SKILL_DIR/scripts/google-drive.py files upload ./presentation.pdf --name "Q4 Presentation"
# 与同事共享
$SKILL_DIR/scripts/google-drive.py share FILE_ID --email colleague@example.com --role writer
使用 --convert-to 将上传的文件转换为 Google 原生格式:
# 上传 HTML 并转换为 Google 文档
$SKILL_DIR/scripts/google-drive.py files upload ./report.html \
--convert-to "application/vnd.google-apps.document"
# 上传 CSV 并转换为 Google 表格
$SKILL_DIR/scripts/google-drive.py files upload ./data.csv \
--convert-to "application/vnd.google-apps.spreadsheet"
$SKILL_DIR/scripts/google-drive.py files delete FILE_ID
$SKILL_DIR/scripts/google-drive.py files rename FILE_ID --name "New Name"
# 使用默认名称复制("Copy of <原始名称>")
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID
# 使用自定义名称复制到特定文件夹
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID --name "Backup" --parent FOLDER_ID
# 创建文件夹
$SKILL_DIR/scripts/google-drive.py folders create "Project Documents"
# 将文件上传到该文件夹
$SKILL_DIR/scripts/google-drive.py files upload ./doc1.pdf --parent FOLDER_ID
$SKILL_DIR/scripts/google-drive.py files upload ./doc2.pdf --parent FOLDER_ID
# 列出文件夹内容
$SKILL_DIR/scripts/google-drive.py folders list FOLDER_ID
有关运算符、可搜索字段和查询示例,请参阅 drive-queries.md。
有关与 --mime-type 和搜索查询一起使用的 MIME 类型,请参阅 api-reference.md。
有关尚未实现的操作及其替代方案,请参阅 api-reference.md。
身份验证和范围错误不可重试。 如果命令因身份验证错误、范围不足错误或权限被拒绝错误(退出代码 1)而失败,请停止并通知用户。不要重试或尝试自主修复问题——这些错误需要用户交互(基于浏览器的 OAuth 同意)。请引导用户查看 OAuth 故障排除指南。
可重试的错误:速率限制(HTTP 429)和临时服务器错误(HTTP 5xx)可能在短暂等待后重试成功。所有其他错误都应报告给用户。
此技能需要结构化的输入/输出进行 API 调用。建议使用标准能力模型。
Google 文档、表格和幻灯片不是二进制文件——它们无法直接下载。请使用 Google Drive 网页界面将它们导出为可下载的格式(PDF、DOCX 等)。
每周安装数
139
代码仓库
GitHub Stars
2
首次出现
2026年1月24日
安全审计
安装于
gemini-cli122
opencode121
codex118
cursor118
github-copilot115
amp111
Interact with Google Drive for file management, search, and sharing.
Dependencies : pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml
After installation, verify the skill is properly configured:
$SKILL_DIR/scripts/google-drive.py check
This will check:
If anything is missing, the check command will provide setup instructions.
Google Drive uses OAuth 2.0 for authentication. For complete setup instructions, see:
Create ~/.config/agent-skills/google.yaml:
oauth_client: client_id: your-client-id.apps.googleusercontent.com client_secret: your-client-secret
Run $SKILL_DIR/scripts/google-drive.py check to trigger OAuth flow and verify setup.
On scope or authentication errors, see the OAuth troubleshooting guide.
See permissions.md for read/write classification of each command.
# Setup and auth
$SKILL_DIR/scripts/google-drive.py check
$SKILL_DIR/scripts/google-drive.py auth setup --client-id ID --client-secret SECRET
$SKILL_DIR/scripts/google-drive.py auth reset
$SKILL_DIR/scripts/google-drive.py auth status
# Files
$SKILL_DIR/scripts/google-drive.py files list [--query QUERY] [--max-results N] [--order-by FIELD]
$SKILL_DIR/scripts/google-drive.py files search [--name NAME] [--mime-type TYPE] [--folder ID]
$SKILL_DIR/scripts/google-drive.py files get FILE_ID
$SKILL_DIR/scripts/google-drive.py files download FILE_ID --output PATH
$SKILL_DIR/scripts/google-drive.py files upload PATH [--parent ID] [--name NAME] [--mime-type TYPE] [--convert-to MIME_TYPE]
$SKILL_DIR/scripts/google-drive.py files move FILE_ID --parent FOLDER_ID
$SKILL_DIR/scripts/google-drive.py files delete FILE_ID
$SKILL_DIR/scripts/google-drive.py files rename FILE_ID --name NAME
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID [--name NAME] [--parent ID]
# Folders
$SKILL_DIR/scripts/google-drive.py folders create NAME [--parent ID]
$SKILL_DIR/scripts/google-drive.py folders list FOLDER_ID [--max-results N]
# Sharing and permissions
$SKILL_DIR/scripts/google-drive.py share FILE_ID --email EMAIL [--role ROLE] [--no-notify]
$SKILL_DIR/scripts/google-drive.py permissions list FILE_ID
$SKILL_DIR/scripts/google-drive.py permissions delete FILE_ID PERMISSION_ID
See command-reference.md for full argument details and examples.
$SKILL_DIR/scripts/google-drive.py check
$SKILL_DIR/scripts/google-drive.py files list --query "mimeType='application/pdf'" --max-results 5
$SKILL_DIR/scripts/google-drive.py files search --name "project proposal"
# First, find the file ID
$SKILL_DIR/scripts/google-drive.py files search --name "report.pdf"
# Then download it
$SKILL_DIR/scripts/google-drive.py files download FILE_ID -o ./report.pdf
# Upload the file
$SKILL_DIR/scripts/google-drive.py files upload ./presentation.pdf --name "Q4 Presentation"
# Share with a colleague
$SKILL_DIR/scripts/google-drive.py share FILE_ID --email colleague@example.com --role writer
Use --convert-to to convert uploaded files to native Google formats:
# Upload HTML and convert to Google Docs
$SKILL_DIR/scripts/google-drive.py files upload ./report.html \
--convert-to "application/vnd.google-apps.document"
# Upload CSV and convert to Google Sheets
$SKILL_DIR/scripts/google-drive.py files upload ./data.csv \
--convert-to "application/vnd.google-apps.spreadsheet"
$SKILL_DIR/scripts/google-drive.py files delete FILE_ID
$SKILL_DIR/scripts/google-drive.py files rename FILE_ID --name "New Name"
# Copy with default name ("Copy of <original>")
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID
# Copy with custom name into a specific folder
$SKILL_DIR/scripts/google-drive.py files copy FILE_ID --name "Backup" --parent FOLDER_ID
# Create a folder
$SKILL_DIR/scripts/google-drive.py folders create "Project Documents"
# Upload files to the folder
$SKILL_DIR/scripts/google-drive.py files upload ./doc1.pdf --parent FOLDER_ID
$SKILL_DIR/scripts/google-drive.py files upload ./doc2.pdf --parent FOLDER_ID
# List folder contents
$SKILL_DIR/scripts/google-drive.py folders list FOLDER_ID
See drive-queries.md for operators, searchable fields, and query examples.
See api-reference.md for MIME types used with --mime-type and search queries.
See api-reference.md for operations not yet implemented and their alternatives.
Authentication and scope errors are not retryable. If a command fails with an authentication error, insufficient scope error, or permission denied error (exit code 1), stop and inform the user. Do not retry or attempt to fix the issue autonomously — these errors require user interaction (browser-based OAuth consent). Point the user to the OAuth troubleshooting guide.
Retryable errors : Rate limiting (HTTP 429) and temporary server errors (HTTP 5xx) may succeed on retry after a brief wait. All other errors should be reported to the user.
This skill makes API calls requiring structured input/output. A standard-capability model is recommended.
Google Docs, Sheets, and Slides are not binary files - they cannot be downloaded directly. Use the Google Drive web interface to export them to a downloadable format (PDF, DOCX, etc.).
Weekly Installs
139
Repository
GitHub Stars
2
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
gemini-cli122
opencode121
codex118
cursor118
github-copilot115
amp111
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
99,100 周安装