google-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Docs Skill
Google Docs Skill
Overview
概述
Claude can work with Google Docs to create, edit, and manage documents. This includes writing content, formatting text, inserting images, collaborating with comments, and exporting documents in various formats.
Claude可以处理Google Docs文档,包括创建、编辑和管理文档。这涵盖了撰写内容、设置文本格式、插入图片、通过评论协作以及以多种格式导出文档。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/google-docs/install.sh | bashOr manually:
bash
cp -r skills/google-docs ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/google-docs/install.sh | bash或者手动安装:
bash
cp -r skills/google-docs ~/.canifi/skills/Setup
设置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
首先,确保已安装canifi-env:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefinedcanifi-env set GOOGLE_EMAIL "your-email@gmail.com"
undefinedPrivacy & 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:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
- 使用CDP模式完成浏览器自动化设置
- 在Playwright控制的Chrome窗口中手动登录该服务
- 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
功能
- Create new documents from scratch or templates
- Read and summarize existing documents
- Edit text content and apply formatting
- Insert images, tables, and charts
- Add and respond to comments
- Share documents and manage permissions
- Export documents as PDF, DOCX, or plain text
- Track and review document history
- Use voice typing transcription
- Apply heading styles and create table of contents
- Find and replace text across documents
- 从头开始或基于模板创建新文档
- 读取并总结现有文档
- 编辑文本内容并应用格式
- 插入图片、表格和图表
- 添加和回复评论
- 共享文档并管理权限
- 将文档导出为PDF、DOCX或纯文本格式
- 跟踪和查看文档历史记录
- 使用语音输入转录
- 应用标题样式并创建目录
- 在文档中查找和替换文本
Usage Examples
使用示例
Example 1: Create a Document
示例1:创建文档
User: "Create a meeting notes document for today's standup"
Claude: Creates new Google Doc titled "Standup Notes - [Date]",
adds template with Attendees, Discussion Points, Action Items sections.
Returns: "Created document: [link]"用户:"为今天的站立会议创建一份会议纪要文档"
Claude:创建标题为"Standup Notes - [日期]"的新Google Doc,
添加包含参会人员、讨论要点、行动项的模板。
返回:"已创建文档:[链接]"Example 2: Edit Existing Document
示例2:编辑现有文档
User: "Add a conclusion section to my project proposal doc"
Claude: Opens the specified document, scrolls to end, adds "Conclusion"
heading with appropriate content based on document context.用户:"给我的项目提案文档添加一个结论部分"
Claude:打开指定文档,滚动到末尾,添加"结论"
标题并根据文档上下文添加合适的内容。Example 3: Summarize Document
示例3:总结文档
User: "Summarize the Q4 report document"
Claude: Opens document, reads all content, provides concise summary
of key points, metrics, and conclusions.用户:"总结Q4报告文档"
Claude:打开文档,读取所有内容,提供关键要点、
指标和结论的简洁总结。Example 4: Export Document
示例4:导出文档
User: "Export my resume as a PDF"
Claude: Opens resume document, navigates to File > Download > PDF,
confirms download. Reports: "Resume exported as PDF"用户:"将我的简历导出为PDF"
Claude:打开简历文档,导航到"文件 > 下载 > PDF",
确认下载。回复:"简历已导出为PDF"Authentication Flow
认证流程
- Claude navigates to docs.google.com via Playwright MCP
- Authenticates with GOOGLE_EMAIL if needed
- Handles 2FA if prompted (notifies user via iMessage)
- Maintains session for subsequent document operations
- Claude通过Playwright MCP导航到docs.google.com
- 如有需要,使用GOOGLE_EMAIL进行认证
- 如果提示双因素认证(2FA),通过iMessage通知用户
- 维持会话以进行后续文档操作
Selectors Reference
选择器参考
javascript
// New document button
'#docs-new-button' or '[aria-label="New"]'
// Document title
'.docs-title-input'
// Main editing area
'.kix-appview-editor'
// Document content
'.kix-paragraphrenderer'
// Menu bar items
'.menu-button'
// File menu
'#docs-file-menu'
// Insert menu
'#docs-insert-menu'
// Format menu
'#docs-format-menu'
// Share button
'.docs-titlebar-share-client-button'
// Comments panel
'.docos-anchoreddocoview'
// Find and replace
'Ctrl+H' keyboard shortcutjavascript
// 新建文档按钮
'#docs-new-button' or '[aria-label="New"]'
// 文档标题
'.docs-title-input'
// 主编辑区域
'.kix-appview-editor'
// 文档内容
'.kix-paragraphrenderer'
// 菜单栏项目
'.menu-button'
// 文件菜单
'#docs-file-menu'
// 插入菜单
'#docs-insert-menu'
// 格式菜单
'#docs-format-menu'
// 共享按钮
'.docs-titlebar-share-client-button'
// 评论面板
'.docos-anchoreddocoview'
// 查找和替换
'Ctrl+H' 键盘快捷键Error Handling
错误处理
- Login Failed: Retry 3 times, notify user via iMessage
- Session Expired: Re-authenticate automatically
- Document Not Found: Search Drive for similar names, ask user to clarify
- Permission Denied: Notify user they lack access, offer to request access
- Save Failed: Retry save, if persistent, copy content to clipboard as backup
- Rate Limited: Wait and retry with exponential backoff
- 登录失败:重试3次,通过iMessage通知用户
- 会话过期:自动重新认证
- 文档未找到:在云端硬盘中搜索相似名称,请求用户澄清
- 权限被拒绝:通知用户缺少访问权限,提供请求访问的选项
- 保存失败:重试保存,如果持续失败,将内容复制到剪贴板作为备份
- 速率限制:等待后使用指数退避策略重试
Self-Improvement Instructions
自我改进说明
When you learn a better way to accomplish a task with Google Docs:
- Document the improvement in your response
- Suggest updating this skill file with the new approach
- Include specific keyboard shortcuts or menu paths that work better
- Note any UI changes affecting selectors
当你学会了使用Google Docs完成任务的更好方法时:
- 在回复中记录改进内容
- 建议使用新方法更新此技能文件
- 包含更有效的特定键盘快捷键或菜单路径
- 记录影响选择器的任何UI变化
Notes
注意事项
- Google Docs auto-saves; explicit save is rarely needed
- Large documents may require scrolling to access all content
- Collaborative editing may show other users' cursors
- Some formatting options require the Format menu
- Voice typing requires microphone permissions
- Export formats: PDF, DOCX, ODT, RTF, TXT, HTML, EPUB
- Google Docs会自动保存;很少需要手动保存
- 大型文档可能需要滚动才能访问所有内容
- 协作编辑可能会显示其他用户的光标
- 某些格式选项需要使用格式菜单
- 语音输入需要麦克风权限
- 导出格式:PDF、DOCX、ODT、RTF、TXT、HTML、EPUB