Skip to content

@tank/google-docs

1.2.0

Create, edit, format, and collaborate on Google Docs programmatically. Covers document creation, batch updates, text manipulation with character indexes, paragraph styling, table operations, inline images, headers/footers, sharing permissions, and export to PDF/DOCX. Sources: Google Docs API docs, Google Drive API docs. Triggers: google docs, document, create document, edit document, format text, batch update, paragraph style, table, export PDF, share document, comments, Google Docs API.


name: "@tank/google-docs" description: "Create, edit, format, and collaborate on Google Docs programmatically. Covers document creation, batch updates, text manipulation with character indexes, paragraph styling, table operations, inline images, headers/footers, sharing permissions, and export to PDF/DOCX. Triggers: google docs, document, create document, edit document, format text, batch update, paragraph style, table, export PDF, share document, comments, Google Docs API."

Google Docs

Create, edit, format, and collaborate on Google Docs programmatically.

Overview

This skill teaches AI agents how to interact with Google Docs through the Google Docs API and Google Drive API. It covers document creation, content manipulation, formatting, real-time collaboration, and export workflows.

Capabilities

Document Lifecycle

  • Create new documents with titles and initial content
  • Clone existing documents as templates
  • Move documents between Drive folders
  • Export documents to PDF, DOCX, plain text, or HTML
  • Archive and delete documents

Content Manipulation

  • Insert, replace, and delete text at specific locations
  • Work with headers, footers, and footnotes
  • Manage numbered and bulleted lists
  • Insert and position inline images
  • Create and modify tables (rows, columns, cell content)

Formatting

  • Apply paragraph styles (headings, normal text, title)
  • Set character formatting (bold, italic, underline, font, size, color)
  • Configure page setup (margins, orientation, page size)
  • Apply named styles and custom style presets

Collaboration

  • Share documents with specific users or domains
  • Set permission levels (viewer, commenter, editor)
  • Read and resolve comments and suggestions
  • Track revision history and restore previous versions

Authentication

This skill requires Google OAuth 2.0 credentials with the following scopes:

  • https://www.googleapis.com/auth/documents — Full access to Google Docs
  • https://www.googleapis.com/auth/drive.file — Access to files created by the app

Store credentials securely and never embed them in skill files. Use environment variables or a credential manager.

Example Usage

{
  "action": "createDocument",
  "title": "Weekly Status Report",
  "content": "## Status Update\n\nProject is on track...",
  "folderId": "1a2b3c4d5e"
}

Permissions

PermissionScopeReason
Network*.googleapis.comGoogle Docs and Drive API calls
Networkaccounts.google.comOAuth authentication
FilesystemRead ./**Read local files for upload
SubprocessNoneNot required

Best Practices

  1. Batch updates: Use batchUpdate to combine multiple operations into a single API call
  2. Use document indexes: The Docs API uses character indexes — always calculate positions carefully
  3. Handle rate limits: Implement exponential backoff for 429 responses
  4. Template pattern: Clone a template document instead of building from scratch for consistent formatting

Command Palette

Search skills, docs, and navigate Tank