> ## 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 Chat Integration: Spaces & Messages for AI Agents

> Agents can read and send Google Chat messages and manage spaces and members. Connect with your Google OAuth client.

## Overview

OneCLI connects AI agents to Google Chat through Google's OAuth flow. Agents can read spaces and messages, send and edit messages, and manage spaces and members. The gateway injects the token into every request, so your agent never sees it.

Google Chat uses **your own Google OAuth client**, on OneCLI Cloud and self-hosted alike. One client covers every Google app in OneCLI, so if you've already set one up for another Google app, skip to step 2.

<a id="self-hosted" style={{ scrollMarginTop: "8rem" }} />

## Connect Google Chat

<Steps>
  <Step title="Set up your Google client">
    Follow the [Google setup guide](/docs/integrations/google) once. Enable the **Google Chat API** in your Google Cloud project as part of it.
  </Step>

  <Step title="Connect">
    In the OneCLI dashboard, open **Connections** > **Google Chat** and click **Connect Google Chat**. Pick your Google account and click **Allow**.

    <Frame caption="The Google Chat connect window in OneCLI before a Google client is set up.">
      <img src="https://mintcdn.com/chartdbinc/L4k9tYUENUtEpMY8/images/integrations/google-chat/onecli-connect-google-chat.png?fit=max&auto=format&n=L4k9tYUENUtEpMY8&q=85&s=645a6b5ac4edff4c7e9b1e69b7f09302" alt="OneCLI connect window for Google Chat showing Configuration required, the setup guide link, and the Configure credentials button." width="1056" height="1084" data-path="images/integrations/google-chat/onecli-connect-google-chat.png" />
    </Frame>
  </Step>
</Steps>

## What agents can do

| Area | What agents can do |
| - | - |
| **Spaces** | List and read spaces. Create, update, and delete spaces |
| **Messages** | List and read messages. Send, update, and delete messages |
| **Members** | List and read members. Add and remove members |

## Controlling access

[Grant](/docs/guides/agent-access) the connection to each agent that needs it, and choose per tool what runs freely, what needs approval, and what's blocked. Put **Send message** and **Delete space** behind approval. Organization [rules](/docs/guides/rules) add guardrails on top. A blocked request never reaches Google Chat.

To disconnect, remove the connection in **Connections** > **Google Chat**, then revoke OneCLI at [myaccount.google.com/permissions](https://myaccount.google.com/permissions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.