该技能用于把 Google Docs 文档和 Google Sheets 表格导出为 Markdown,便于后续阅读、处理或入库。它通过 Google API 工作,仅使用只读权限范围(drive.readonly、spreadsheets.readonly),优先使用 gcloud 应用默认凭据(ADC),必要时回退到浏览器 OAuth。
认证:默认运行 gcloud auth application-default login,并带上只读 scope: gcloud auth application-default login --scopes=https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/spreadsheets.readonly
Docs 导出:支持文档 ID 或 URL。加 --stdout 输出到标准输出;不加则默认写入 ./exports 目录。可用 --output-dir 指定目录,并可同时用 --stdout 既写文件又打印。导出经 HTML→Markdown 转换并移除图片,输出文件名默认为文档标题(经清理)加 .md 扩展名。命令示例:uv run --directory ${OPENCODE_DIR}/skill/google-docs-sheets scripts/docs.py export <DOC_ID_OR_URL> --stdout
Sheets 导出:支持表格 ID 或 URL。--stdout 输出到标准输出,否则默认写入 ./exports。可用 --tab 指定标签页(可多次),--header-row 指定表头行,--no-header 关闭表头。每个标签页导出为独立 Markdown 表格,文件名格式为“表格标题 - 标签页标题.md”。若 URL 含 gid=...,会自动选择该标签页(除非使用了 --tab)。命令示例:uv run --directory ${OPENCODE_DIR}/skill/google-docs-sheets scripts/sheets.py export <SHEET_ID_OR_URL> --stdout
限制:仅只读,不能写入 Google 文档或表格;导出会移除图片;其余如配额、速率限制、支持的文件类型范围等资料暂未提供。