google-docs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google 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 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/docs.py
. Auto-authenticates on first use if not logged in.
bash
undefined
所有操作通过
scripts/docs.py
执行。若未登录,首次使用时将自动完成认证。
bash
undefined

Create 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获取文本

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"
undefined
python scripts/docs.py replace-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms "old text" "new text"
undefined

Document ID Format

文档ID格式

Google Docs uses document IDs like
1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
. You can:
  • Use the full URL (the ID will be extracted automatically)
  • Use just the document ID
  • Get document IDs from the
    find
    command results
Google Docs使用类似
1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
的文档ID。您可以:
  • 使用完整URL(系统将自动提取ID)
  • 直接使用文档ID
  • find
    命令的结果中获取文档ID

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-oauth
Access 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云函数自动刷新。