google-docs
Installation
SKILL.md
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.
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(""))'