google-drive

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google 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 login
Check authentication status:
bash
python scripts/auth.py status
Logout 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 logout

Commands

命令

All operations via
scripts/drive.py
. Auto-authenticates on first use if not logged in.
bash
undefined
所有操作通过
scripts/drive.py
执行。若未登录,首次使用时将自动完成认证。
bash
undefined

Search 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
undefined
python scripts/drive.py download 1ABC123xyz ./downloads/report.pdf
undefined

Search Query Formats

搜索查询格式

The search command supports multiple query formats:
FormatExampleDescription
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
搜索命令支持多种查询格式:
格式示例说明
全文搜索
"quarterly report"
搜索文件内容及名称
标题搜索
"title:budget"
仅搜索文件名称
URL
https://drive.google.com/...
自动提取并使用文件/文件夹ID
文件夹ID
1ABC123...
列出文件夹内容(25位以上字符的ID)
原生查询
mimeType='application/pdf'
直接使用Drive原生查询语法

File ID Format

文件ID格式

Google Drive uses long IDs like
1ABC123xyz_-abc123
. Get IDs from:
  • search
    results
  • find-folder
    results
  • list
    results
  • Google Drive URLs
Google Drive使用类似
1ABC123xyz_-abc123
的长ID。可从以下途径获取ID:
  • 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-oauth
Automatically 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云函数自动刷新过期令牌。