Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

google-docsGoogle Docs 文档协作

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

768

周安装

33

GitHub Stars

55

下载量

269
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:google-docs(Google Docs 文档协作)
来源仓库:https://github.com/vm0-ai/vm0-skills
仓库路径:skills/google-docs
安装命令:
npx skills add https://github.com/vm0-ai/vm0-skills --skill google-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/vm0-ai/vm0-skills --skill google-docs

简介

google-docs 用于辅助文档、README 和内容稿件的整理与改写。

  • 适合提炼结构、补齐章节、统一术语或检查链接,提升文档可读性。
  • 通过 npx skills add 命令从 GitHub 仓库安装并使用。
  • 使用时应保留已有事实和路径,避免写成确定结论;对外文案需控制语气。
  • 可结合原始 README 进一步核验具体用法和功能细节。

SKILL.md

How to Use

Base URL: https://docs.googleapis.com/v1

Finding your Document ID: The document ID is in the URL: https://docs.google.com/document/d/{DOCUMENT_ID}/edit

1. Create New Document

Create a blank document with a title:

Write to /tmp/gdocs_request.json:

{
  "title": "My New Document"
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '{documentId, title, documentUrl: ("https://docs.google.com/document/d/" + .documentId + "/edit")}'

2. Get Document Content

Read the entire document structure and content:

curl -s "https://docs.googleapis.com/v1/documents/{document-id}" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" | jq '{title: .title, body: .body.content}'

3. Get Document Metadata Only

Get just the title and basic properties:

curl -s "https://docs.googleapis.com/v1/documents/{document-id}" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" | jq '{documentId, title, revisionId, suggestionsViewMode}'

4. Insert Text at Beginning

Insert text at the start of the document (index 1):

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertText": {
        "location": {
          "index": 1
        },
        "text": "Hello, this is my first paragraph.\n"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

5. Insert Text at Specific Location

Insert text at a specific index (get indexes from document content):

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertText": {
        "location": {
          "index": 25
        },
        "text": "This is inserted text.\n"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

6. Delete Content Range

Delete text from a specific range:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "deleteContentRange": {
        "range": {
          "startIndex": 1,
          "endIndex": 50
        }
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

7. Find and Replace Text

Replace all occurrences of text throughout the document:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "replaceAllText": {
        "containsText": {
          "text": "old text",
          "matchCase": true
        },
        "replaceText": "new text"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies[0].replaceAllText'

8. Format Text as Bold

Make text bold in a specific range:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "updateTextStyle": {
        "range": {
          "startIndex": 1,
          "endIndex": 20
        },
        "textStyle": {
          "bold": true
        },
        "fields": "bold"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

9. Format Text with Multiple Styles

Apply multiple text styles (bold, italic, font size, color):

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "updateTextStyle": {
        "range": {
          "startIndex": 1,
          "endIndex": 30
        },
        "textStyle": {
          "bold": true,
          "italic": true,
          "fontSize": {
            "magnitude": 14,
            "unit": "PT"
          },
          "foregroundColor": {
            "color": {
              "rgbColor": {
                "red": 0.2,
                "green": 0.4,
                "blue": 0.8
              }
            }
          }
        },
        "fields": "bold,italic,fontSize,foregroundColor"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

10. Set Paragraph Alignment

Change paragraph alignment (LEFT, CENTER, RIGHT, JUSTIFIED):

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "updateParagraphStyle": {
        "range": {
          "startIndex": 1,
          "endIndex": 50
        },
        "paragraphStyle": {
          "alignment": "CENTER"
        },
        "fields": "alignment"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

11. Create Bulleted List

Convert paragraphs to a bulleted list:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "createParagraphBullets": {
        "range": {
          "startIndex": 1,
          "endIndex": 100
        },
        "bulletPreset": "BULLET_DISC_CIRCLE_SQUARE"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

Available bullet presets:

  • BULLET_DISC_CIRCLE_SQUARE
  • BULLET_DIAMONDX_ARROW3D_SQUARE
  • BULLET_CHECKBOX
  • NUMBERED_DECIMAL_ALPHA_ROMAN
  • NUMBERED_DECIMAL_NESTED

12. Insert Table

Insert a table with specified rows and columns:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertTable": {
        "rows": 3,
        "columns": 4,
        "location": {
          "index": 1
        }
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

13. Insert Page Break

Insert a page break at a specific location:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertPageBreak": {
        "location": {
          "index": 50
        }
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

14. Insert Inline Image

Insert an image from a URL:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertInlineImage": {
        "uri": "https://example.com/image.png",
        "location": {
          "index": 1
        },
        "objectSize": {
          "height": {
            "magnitude": 200,
            "unit": "PT"
          },
          "width": {
            "magnitude": 300,
            "unit": "PT"
          }
        }
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // .replies // "done"'

15. Batch Operations (Multiple Updates)

Combine multiple operations in a single request:

Write to /tmp/gdocs_request.json:

{
  "requests": [
    {
      "insertText": {
        "location": {
          "index": 1
        },
        "text": "Title: Important Document\n\n"
      }
    },
    {
      "updateTextStyle": {
        "range": {
          "startIndex": 1,
          "endIndex": 26
        },
        "textStyle": {
          "bold": true,
          "fontSize": {
            "magnitude": 18,
            "unit": "PT"
          }
        },
        "fields": "bold,fontSize"
      }
    },
    {
      "insertText": {
        "location": {
          "index": 28
        },
        "text": "This is the body text of the document.\n"
      }
    }
  ]
}

Then run:

curl -s -X POST "https://docs.googleapis.com/v1/documents/{document-id}:batchUpdate" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" --header "Content-Type: application/json" -d @/tmp/gdocs_request.json | jq '.error // (.replies | length)'

16. Extract Plain Text

Get just the text content from a document:

curl -s "https://docs.googleapis.com/v1/documents/{document-id}" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" | jq -r '.body.content[]?.paragraph?.elements[]?.textRun?.content' | tr -d '\0'

17. Get Document Structure

View document structure with element types and indexes:

curl -s "https://docs.googleapis.com/v1/documents/{document-id}" --header "Authorization: Bearer $GOOGLE_DOCS_TOKEN" | jq '.body.content[] | {startIndex, endIndex, paragraph: .paragraph.elements[0].textRun.content}'

Common Scopes

ScopePermission
documents.readonlyRead-only access
documentsFull read/write access
drive.readonlyRead files in Drive
drive.fileAccess files created by app
driveFull Drive access

Use full URL: https://www.googleapis.com/auth/documents

Index Reference

Understanding indexes is critical for the Google Docs API:

  • Index 1: Start of document body
  • Index N: Each character, newline, and structural element increments the index
  • End index: Use "endIndex": startIndex + textLength for ranges
  • Tip: Get document content first to see current indexes

Text Style Fields

When using updateTextStyle, specify which fields to update in the fields parameter:

FieldDescription
boldBold text
italicItalic text
underlineUnderline text
strikethroughStrikethrough text
fontSizeFont size (PT or PX)
foregroundColorText color (RGB)
backgroundColorBackground color (RGB)
fontFamilyFont name (e.g., "Arial")
baselineOffsetSuperscript/subscript
linkHyperlink URL

Use comma-separated for multiple: "fields": "bold,italic,fontSize"

Paragraph Style Fields

When using updateParagraphStyle:

FieldDescription
alignmentLEFT, CENTER, RIGHT, JUSTIFIED
lineSpacingLine spacing percentage (100 = single)
directionLEFT_TO_RIGHT or RIGHT_TO_LEFT
spaceAboveSpace before paragraph
spaceBelowSpace after paragraph
indentFirstLineFirst line indentation
indentStartLeft indentation
indentEndRight indentation
namedStyleTypeHEADING_1, HEADING_2, NORMAL_TEXT, etc.

Guidelines

  1. Batch operations: Combine multiple requests in a single batchUpdate call to improve performance
  2. Index calculation: Always get current document content to determine correct indexes
  3. Request order: Requests are processed in order; later requests see effects of earlier ones
  4. Fields parameter: Always specify which fields to update to avoid overwriting other properties
  5. RGB colors: Color values range from 0.0 to 1.0 (not 0-255)
  6. Share permissions: Ensure the authenticated user has edit access to the document
  7. batchUpdate responses: Some operations (updateParagraphStyle, insertTable, insertPageBreak, insertInlineImage) return empty or absent .replies; output of "done" means success with no reply data. An .error key indicates failure.

API Reference

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.76%
按下载量换算96

Claude

29.77%
按下载量换算80

Cursor

18.08%
按下载量换算49

Gemini CLI

8.79%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills