> ## 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 Drive Integration: File Access for Agents

> Search, read, create, and organize files and folders in Google Drive. Supports Docs, Sheets, and uploaded files.

## Overview

OneCLI connects AI agents to Google Drive through Google's OAuth flow. Agents can search for files, read their contents, create new files, and organize them into folders. The gateway injects OAuth credentials into requests to the Google Drive API automatically.

This is useful for agents that need to find documents, store outputs, or work with files shared across your team.

## Setup

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

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

## What agents can do

* Search for files and folders by name, type, owner, or content
* Read file metadata (name, size, sharing settings, last modified)
* Download file contents, including [Google Docs](/docs/integrations/google-docs)/[Sheets](/docs/integrations/google-sheets)/[Slides](/docs/integrations/google-slides) exported to common formats
* Upload new files to any folder
* Create folders and organize files within them
* Move, rename, and delete files
* List files in a specific folder or shared drive
* Manage file permissions (share, unshare, change access levels)
* List and access shared drives

## 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 Drive.
