google-drive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Drive
Google Drive
Lightweight Google Drive integration with standalone OAuth authentication. No MCP server required.
⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.
轻量级Google Drive集成工具,采用独立OAuth认证,无需MCP服务器。
⚠️ 需使用Google Workspace账户。 个人Gmail账户不被支持。
First-Time Setup
首次设置
Authenticate with Google (opens browser):
bash
python scripts/auth.py loginCheck authentication status:
bash
python scripts/auth.py statusLogout when needed:
bash
python scripts/auth.py logout通过Google完成认证(将打开浏览器):
bash
python scripts/auth.py login检查认证状态:
bash
python scripts/auth.py status需要时退出登录:
bash
python scripts/auth.py logoutCommands
命令
All operations via . Auto-authenticates on first use if not logged in.
scripts/drive.pybash
undefined所有操作通过执行。若未登录,首次使用时将自动完成认证。
scripts/drive.pybash
undefinedSearch for files (full-text search)
Search for files (full-text search)
python scripts/drive.py search "quarterly report"
python scripts/drive.py search "quarterly report"
Search by title only
Search by title only
python scripts/drive.py search "title:budget"
python scripts/drive.py search "title:budget"
Search using Google Drive URL (extracts ID automatically)
Search using Google Drive URL (extracts ID automatically)
python scripts/drive.py search "https://drive.google.com/drive/folders/1ABC123..."
python scripts/drive.py search "https://drive.google.com/drive/folders/1ABC123..."
Search files shared with you
Search files shared with you
python scripts/drive.py search --shared-with-me
python scripts/drive.py search --shared-with-me
Search with pagination
Search with pagination
python scripts/drive.py search "report" --limit 5 --page-token "..."
python scripts/drive.py search "report" --limit 5 --page-token "..."
Find a folder by exact name
Find a folder by exact name
python scripts/drive.py find-folder "Project Documents"
python scripts/drive.py find-folder "Project Documents"
List files in root Drive
List files in root Drive
python scripts/drive.py list
python scripts/drive.py list
List files in a specific folder
List files in a specific folder
python scripts/drive.py list 1ABC123xyz --limit 20
python scripts/drive.py list 1ABC123xyz --limit 20
Download a file
Download a file
python scripts/drive.py download 1ABC123xyz ./downloads/report.pdf
undefinedpython scripts/drive.py download 1ABC123xyz ./downloads/report.pdf
undefinedSearch Query Formats
搜索查询格式
The search command supports multiple query formats:
| Format | Example | Description |
|---|---|---|
| Full-text | | Searches file contents and names |
| Title | | Searches file names only |
| URL | | Extracts and uses file/folder ID |
| Folder ID | | Lists folder contents (25+ char IDs) |
| Native query | | Pass-through Drive query syntax |
搜索命令支持多种查询格式:
| 格式 | 示例 | 说明 |
|---|---|---|
| 全文搜索 | | 搜索文件内容及名称 |
| 标题搜索 | | 仅搜索文件名称 |
| URL | | 自动提取并使用文件/文件夹ID |
| 文件夹ID | | 列出文件夹内容(25位以上字符的ID) |
| 原生查询 | | 直接使用Drive原生查询语法 |
File ID Format
文件ID格式
Google Drive uses long IDs like . Get IDs from:
1ABC123xyz_-abc123- results
search - results
find-folder - results
list - Google Drive URLs
Google Drive使用类似的长ID。可从以下途径获取ID:
1ABC123xyz_-abc123- 结果
search - 结果
find-folder - 结果
list - Google Drive网址
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
- 常规文件(PDF、图片等)可直接下载
- Google Docs/Sheets/Slides无法通过此工具下载
- 对于Google Workspace文件,请使用导出功能或专用工具
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-oauthAutomatically refreshes expired tokens using Google's cloud function.
令牌通过系统密钥环安全存储:
- macOS:Keychain
- Windows:Windows凭据管理器
- Linux:Secret Service API(GNOME Keyring、KDE Wallet等)
服务名称:
google-drive-skill-oauth将通过Google云函数自动刷新过期令牌。