google-docs · acedatacloud — скилл для Claude Code: что делает и как установить
Позволяет читать, создавать и редактировать документы Google Docs через официальный REST API с помощью curl и jq.
Apache-2.0 175 установок ★ 17 обновлён 2026-10-25
npx skills add AceDataCloud/Skills --skill google-docs -a claude-codeЧто делает google-docs
Скилл подключает агент к Google Docs REST API v1 через curl и утилиту jq. Он извлекает чистый текст из древовидной структуры блоков документа, создаёт новые файлы в корневом каталоге Google Drive и правит содержимое через метод batchUpdate. Идентификатор документа берётся из пути ссылки или через поиск.
Для авторизации инструмент использует OAuth bearer-токен из переменной окружения $GOOGLE_DOCS_TOKEN. По умолчанию коннектор выдаёт права только на чтение documents.readonly. Запись требует расширенного разрешения documents, иначе запросы завершаются ошибкой 403 PERMISSION_DENIED.
Правки текста опираются на посимвольные индексы документа: каждая вставка смещает позиции последующих символов. Из-за этого серии изменений нужно выполнять с конца к началу или пересчитывать индексы между вызовами.
Какие задачи решает
- читать текст из документов Google Docs без открытия браузера
- создавать пустые документы с заданным названием напрямую из консоли
- вставлять текст по числовому индексу позиции
- заменять заполнители и переменные по всему тексту документа
Примеры запросов агенту
- Прочитай содержимое документа с идентификатором
DOC_ID - Создай новый Google Doc с названием «План спринта»
- Замени все совпадения маркера
{{name}}наАлексейв документеDOC_ID
Как установить google-docs
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill google-docs -a claude-code2Вручную: положить файлы
~/.claude/skills/google-docs/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/google-docs/
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill google-docs -a codex2Вручную: положить файлы
.agents/skills/google-docs/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill google-docs -a cursor2Вручную: положить файлы
.cursor/skills/google-docs/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install AceDataCloud/Skills skills/google-docs2Вручную: положить файлы
.github/skills/google-docs/SKILL.md1Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill google-docs -a gemini-cli2Командой платформы
gemini skills install https://github.com/AceDataCloud/Skills --path skills/google-docsВручную: положить файлы
.devin/skills/google-docs/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add AceDataCloud/Skills --skill google-docs -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о google-docs
Как установить google-docs в Claude Code?
Выполните команду npx skills add AceDataCloud/Skills --skill google-docs -a claude-code. Файл манифеста сохранится по пути ~/.claude/skills/google-docs/SKILL.md.
Что делает этот скилл?
Он отправляет запросы к REST API Google Docs через curl, позволяя парсить структуру документа, добавлять текст и проводить пакетные правки.
Почему редактирование завершается ошибкой 403 PERMISSION_DENIED?
По умолчанию подключение получает скоуп documents.readonly. Для внесения изменений при установке необходимо выдать полные права documents.
Исходный текст
SKILL.md · Apache-2.0
---
name: google-docs
description: Read and edit Google Docs via the Docs v1 REST API. Use when the user mentions a Google Doc, reading a document's text, creating a doc, inserting or replacing text, or exporting a doc's content.
when_to_use: |
Trigger when the user wants to read a Google Doc's content, create a
new doc, or insert / replace text in one. The connector grants
`documents.readonly` by default; the user opts in to `documents`
(read + write) at install — confirm before edits. Find the doc id
from a Drive URL or a google-drive search.
connections: [google/docs]
allowed_tools: [Bash]
license: Apache-2.0
metadata:
author: acedatacloud
version: "1.0"
---
Drive **Google Docs** via `curl + jq`. The user's OAuth bearer token is in
`$GOOGLE_DOCS_TOKEN`; every call needs `Authorization: Bearer
$GOOGLE_DOCS_TOKEN`. Base URL: `https://docs.googleapis.com/v1/documents`. The
token carries `documents.readonly` (+ identity); writes need `documents`.
Failures are `{"error":{"code","message","status"}}` — show verbatim. `401` =
re-install. `403 PERMISSION_DENIED` on a write = read-only scope.
The doc id is the `…/document/d/<ID>/edit` segment of the URL.
```bash
D="https://docs.googleapis.com/v1/documents"; AUTH="Authorization: Bearer $GOOGLE_DOCS_TOKEN"
# Read the document. The body is a tree of structural elements; pull plain text:
curl -sS -H "$AUTH" "$D/DOC_ID" \
| jq -r '.title, ([.body.content[]?.paragraph?.elements[]?.textRun?.content] | join(""))'
```
## Create & edit
```bash
# Create an empty doc
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d '{"title":"Meeting notes 2026-06-21"}' "$D" | jq '{documentId, title}'
# Insert text at the start (index 1) via batchUpdate (confirm first)
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d '{"requests":[{"insertText":{"location":{"index":1},"text":"Hello\n"}}]}' \
"$D/DOC_ID:batchUpdate" | jq '.documentId'
# Replace all occurrences of a placeholder
curl -sS -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d '{"requests":[{"replaceAllText":{"containsText":{"text":"{{name}}","matchCase":true},"replaceText":"Alex"}}]}' \
"$D/DOC_ID:batchUpdate" | jq '.replies'
```
## Gotchas
- The document model is **index-based**: text edits target character indices, and
every insert shifts later indices — for multiple inserts, apply them
back-to-front or recompute indices between calls.
- To get clean Markdown/plain text, walk `body.content[].paragraph.elements[]
.textRun.content` (the jq above). Tables / lists need deeper traversal.
- Creating a doc puts it in the user's Drive root; use the `google-drive` skill to
move/share it.
© acedatacloud · Apache-2.0 · AceDataCloud/Skills
Похожие скиллы
Все скиллы по теме «Тексты и документация» →Сначала — google-docs от других авторов.