> ## 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](/integrations/google-docs)/[Sheets](/integrations/google-sheets)/[Slides](/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 with rules

Use OneCLI's [rules engine](/guides/rules) to limit what agents can do with your files. For example, you can block delete operations so agents can read and create but never remove files, or restrict write access to a specific folder. Rules are evaluated before credential injection, so a blocked request never reaches Google Drive.
