> ## Documentation Index
> Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Docs Integration: Read & Edit Documents

> Read and edit Google Docs programmatically. Agents can create documents, insert text, and format content via the Docs API.

## Overview

OneCLI connects AI agents to Google Docs through Google's OAuth flow. Agents can read document content, create new documents, and edit existing ones. The gateway injects OAuth credentials into requests to the Google Docs API automatically.

This is useful for agents that generate reports, draft documentation, or need to read information stored in Google Docs. To manage the files themselves (search, organize, share), see [Google Drive](/docs/integrations/google-drive).

## Setup

<Steps>
  <Step title="Go to Connections">
    Open the OneCLI dashboard and navigate to **Connections** > **Google Docs**.
  </Step>

  <Step title="Authorize">
    Click **Connect Google Docs**. You'll be redirected to Google to authorize OneCLI. Review the permissions and click **Allow**.
  </Step>
</Steps>

## What agents can do

* Read the full text content of a document
* Get document structure (headings, paragraphs, tables, lists)
* Create new documents with formatted content
* Insert, replace, or delete text in existing documents
* Add and modify tables, headers, and footers
* Apply text formatting (bold, italic, font size, color)
* Insert images and links into documents
* Read and add comments on a document

## Controlling access

Access is per agent: [grant](/docs/guides/agent-access) the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked — a read-only agent is a single grant. Organization [rules](/docs/guides/rules) add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Google Docs.
