google-docs-automation
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
Create a new document
python scripts/docs.py create "Meeting Notes"
python scripts/docs.py create "Meeting Notes"
Create a document with initial content
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
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
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
Get text using a full 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
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
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
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云函数自动刷新。