google-drive

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Drive Skill

Google Drive 技能

Overview

概述

Claude can manage your Google Drive to upload files, organize folders, search content, share files, and maintain your cloud storage. This includes managing permissions, syncing across devices, and integrating with other Google Workspace apps.
Claude可以管理你的Google Drive,包括上传文件、整理文件夹、搜索内容、共享文件以及维护你的云存储。这包括权限管理、跨设备同步,以及与其他Google Workspace应用集成。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/google-drive/install.sh | bash
Or manually:
bash
cp -r skills/google-drive ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/google-drive/install.sh | bash
或者手动安装:
bash
cp -r skills/google-drive ~/.canifi/skills/

Setup

设置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

首先,确保canifi-env已安装:

canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefined
canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭证,由你掌控。 Canifi LifeOS尊重你的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭证:
  1. 使用CDP模式完成浏览器自动化设置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. Claude将使用你的已认证会话,且永远不会看到你的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭证,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭证仅能在你的本地机器上访问,绝不会被传输。

Capabilities

功能

  • Upload and download files
  • Create and organize folders
  • Search files by name, type, or content
  • Share files and folders with permissions
  • Move and copy files between folders
  • View and restore file versions
  • Empty trash and manage storage
  • Create shortcuts to files
  • Star and organize important files
  • View storage usage and quota
  • Access shared drives and team folders
  • Preview documents, images, and videos
  • 上传和下载文件
  • 创建和整理文件夹
  • 按名称、类型或内容搜索文件
  • 共享文件和文件夹并设置权限
  • 在文件夹之间移动和复制文件
  • 查看和恢复文件版本
  • 清空回收站并管理存储
  • 创建文件快捷方式
  • 标记和整理重要文件
  • 查看存储使用情况和配额
  • 访问共享驱动器和团队文件夹
  • 预览文档、图片和视频

Usage Examples

使用示例

Example 1: Find a File

示例1:查找文件

User: "Find my resume document"
Claude: Searches Drive for "resume", returns results:
        "Found 3 files: Resume_2024.docx (modified yesterday),
        Resume_old.pdf (3 months ago)..."
用户:"找到我的简历文档"
Claude:在Drive中搜索“resume”,返回结果:
        "找到3个文件:Resume_2024.docx(昨天修改),
        Resume_old.pdf(3个月前)..."

Example 2: Organize Files

示例2:整理文件

User: "Create a folder for Q4 reports and move all Q4 files there"
Claude: Creates "Q4 Reports" folder, searches for Q4-related files,
        moves them to new folder. Reports: "Created folder, moved 12 files"
用户:"创建一个Q4报告文件夹,并将所有Q4文件移动到那里"
Claude:创建“Q4 Reports”文件夹,搜索所有与Q4相关的文件,
        将它们移动到新文件夹。回复:"已创建文件夹,移动了12个文件"

Example 3: Share File

示例3:共享文件

User: "Share the project proposal with john@example.com as editor"
Claude: Locates file, opens sharing dialog, adds john@example.com with edit
        permissions. Confirms: "Shared with john@example.com (Editor access)"
用户:"将项目提案以编辑权限共享给john@example.com"
Claude:定位文件,打开共享对话框,添加john@example.com并赋予编辑
        权限。确认:"已与john@example.com共享(编辑权限)"

Example 4: Check Storage

示例4:检查存储

User: "How much Drive storage am I using?"
Claude: Opens storage view, reads usage. Reports:
        "Using 8.2 GB of 15 GB (54%). Largest files: video.mp4 (2.1GB)..."
用户:"我正在使用多少Drive存储?"
Claude:打开存储视图,读取使用情况。回复:
        "已使用8.2 GB,共15 GB(54%)。最大文件:video.mp4(2.1GB)..."

Authentication Flow

认证流程

  1. Claude navigates to drive.google.com via Playwright MCP
  2. Authenticates with GOOGLE_EMAIL if needed
  3. Handles 2FA if prompted (notifies user via iMessage)
  4. Maintains session for subsequent Drive operations
  1. Claude通过Playwright MCP导航到drive.google.com
  2. 如有需要,使用GOOGLE_EMAIL进行认证
  3. 若提示2FA则处理(通过iMessage通知用户)
  4. 维护会话以进行后续Drive操作

Selectors Reference

选择器参考

javascript
// New button
'[aria-label="New"]'

// Search box
'input[aria-label="Search in Drive"]'

// File list
'.Q5txwe' // File rows

// File name
'.KL4NAf'

// Folder navigation
'.a-fc-Uc' // Breadcrumb

// Context menu
'[role="menu"]'

// Share button
'[aria-label="Share"]'

// Download button
'[aria-label="Download"]'

// Move to button
'[aria-label="Move to"]'

// Trash button
'[aria-label="Move to trash"]'

// Storage indicator
'.a-Ja-we'

// Upload file
'[aria-label="File upload"]'

// Create folder
'[aria-label="Folder"]'
javascript
// 新建按钮
'[aria-label="New"]'

// 搜索框
'input[aria-label="Search in Drive"]'

// 文件列表
'.Q5txwe' // 文件行

// 文件名
'.KL4NAf'

// 文件夹导航
'.a-fc-Uc' // 面包屑

// 上下文菜单
'[role="menu"]'

// 共享按钮
'[aria-label="Share"]'

// 下载按钮
'[aria-label="Download"]'

// 移动到按钮
'[aria-label="Move to"]'

// 回收站按钮
'[aria-label="Move to trash"]'

// 存储指示器
'.a-Ja-we'

// 上传文件
'[aria-label="File upload"]'

// 创建文件夹
'[aria-label="Folder"]'

Error Handling

错误处理

  • Login Failed: Retry 3 times, notify user via iMessage
  • Session Expired: Re-authenticate automatically
  • File Not Found: Search with variations, ask user to clarify
  • Upload Failed: Retry with smaller chunks, check file size limits
  • Share Failed: Verify email address, check sharing restrictions
  • Storage Full: Notify user, suggest cleanup options
  • Permission Denied: Notify user, explain access requirements
  • 登录失败:重试3次,通过iMessage通知用户
  • 会话过期:自动重新认证
  • 文件未找到:使用变体关键词搜索,请求用户澄清
  • 上传失败:以更小的分块重试,检查文件大小限制
  • 共享失败:验证邮箱地址,检查共享限制
  • 存储已满:通知用户,建议清理选项
  • 权限被拒绝:通知用户,解释访问要求

Self-Improvement Instructions

自我改进说明

When you learn a better way to accomplish a task with Google Drive:
  1. Document the improvement in your response
  2. Suggest updating this skill file with the new approach
  3. Include specific search operators or navigation tips
  4. Note any organizational best practices
当你学会使用Google Drive完成任务的更好方法时:
  1. 在回复中记录改进内容
  2. 建议使用新方法更新此技能文件
  3. 包含具体的搜索运算符或导航技巧
  4. 记录任何组织最佳实践

Notes

注意事项

  • Free storage: 15 GB shared across Drive, Gmail, Photos
  • Maximum file size: 5 TB
  • Search operators: type:pdf, owner:me, before:2024-01-01
  • Shared drives for team collaboration
  • Offline access available for specific files
  • Version history retained for 30 days (or 100 versions)
  • Trash auto-deletes after 30 days
  • Keyboard shortcuts: N for new, / for search
  • 免费存储:15 GB,在Drive、Gmail、相册之间共享
  • 最大文件大小:5 TB
  • 搜索运算符:type:pdf, owner:me, before:2024-01-01
  • 用于团队协作的共享驱动器
  • 特定文件支持离线访问
  • 版本历史保留30天(或100个版本)
  • 回收站内容30天后自动删除
  • 键盘快捷键:N新建,/搜索