关于 google-docs
Google Docs 是一款通过独立 OAuth 身份验证操作 Google Docs 的轻量技能,无需 MCP 服务。它面向 Google Workspace 用户,提供命令行文档操作。
主要功能
- 01独立 OAuth 登录和退出
- 02查看身份验证状态
- 03创建文档并可添加内容
- 04按标题查找文档
- 05使用系统密钥环安全存储令牌
适用场景
- 01创建会议记录或项目计划
- 02按标题查找文档
- 03验证身份并管理 Google Docs 访问
MCP 相关
此技能无需 MCP 服务;它通过独立 OAuth 身份验证访问 Google Docs。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ sanjay3290/ ai-skills --skill google-docs安装后在 Claude Code 中输入/google-docs确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
README.mdrequirements.txtscripts/auth.pydocs.pyrequirements.txt详细介绍
Google Docs
轻量级 Google Docs 集成,采用独立 OAuth 身份验证。无需 MCP 服务。
⚠️ 需要 Google Workspace 账号。 不支持个人 Gmail 账号。
首次设置
使用 Google 进行身份验证(将打开浏览器):
python scripts/auth.py login
检查身份验证状态:
python scripts/auth.py status
需要时注销:
python scripts/auth.py logout
命令
所有操作均通过 scripts/docs.py 执行。首次使用时,如果尚未登录,会自动进行身份验证。
# Create a new document
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."
# Find documents by title
python scripts/docs.py find "meeting" --limit 10
# Get text content of a document
python scripts/docs.py get-text 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
# Get text using a full URL
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."
# Insert text at beginning of document
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"
文档 ID 格式
Google Docs 使用类似 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms 的文档 ID。你可以:
- 使用完整 URL(系统会自动提取 ID)
- 仅使用文档 ID
- 从
find命令的结果中获取文档 ID
令牌管理
令牌使用系统密钥环安全存储:
- macOS:Keychain
- Windows:Windows Credential Locker
- Linux:Secret Service API(GNOME Keyring、KDE Wallet 等)
服务名称:google-docs-skill-oauth
访问令牌过期时,会使用 Google 的云函数自动刷新。
评论
支持 Markdown