google-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Docs
Google Docs
Lightweight Google Docs integration with standalone OAuth authentication. No MCP server required.
⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.
轻量级Google Docs集成方案,具备独立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/docs.pybash
undefined所有操作通过执行。若未登录,首次使用时将自动完成认证。
scripts/docs.pybash
undefinedCreate a new document
创建新文档
python scripts/docs.py create "Meeting Notes"
python scripts/docs.py create "Meeting Notes"
Create a document with initial content
创建包含初始内容的文档
python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the project plan."
python scripts/docs.py create "Project Plan" --content "# Overview\n\nThis is the project plan."
Find documents by title
按标题查找文档
python scripts/docs.py find "meeting" --limit 10
python scripts/docs.py find "meeting" --limit 10
Get text content of a document
获取文档的文本内容
python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
Get text using a full URL
通过完整URL获取文本
python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
python scripts/docs.py get-text "https://docs.google.com/document/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
Append text to end of document
在文档末尾追加文本
python scripts/docs.py append-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "New paragraph at the end."
python scripts/docs.py append-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "New paragraph at the end."
Insert text at beginning of document
在文档开头插入文本
python scripts/docs.py insert-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "Text at the beginning.\n\n"
python scripts/docs.py insert-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "Text at the beginning.\n\n"
Replace text in document
替换文档中的文本
python scripts/docs.py replace-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "old text" "new text"
undefinedpython scripts/docs.py replace-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "old text" "new text"
undefinedDocument ID Format
文档ID格式
Google Docs uses document IDs like . You can:
1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms- Use the full URL (the ID will be extracted automatically)
- Use just the document ID
- Get document IDs from the command results
find
Google Docs使用类似的文档ID。您可以:
1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms- 使用完整URL(系统将自动提取ID)
- 直接使用文档ID
- 从命令的结果中获取文档ID
find
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-docs-skill-oauthAccess tokens are automatically refreshed when expired using Google's cloud function.
令牌通过系统密钥环安全存储:
- macOS: Keychain
- Windows: Windows Credential Locker
- Linux: Secret Service API(GNOME Keyring、KDE Wallet等)
服务名称:
google-docs-skill-oauth访问令牌过期时,将通过Google云函数自动刷新。