> ## 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 Spaces and Messages

> Read and send Google Chat messages, and manage spaces and members. Connect with your Google OAuth client, and the gateway injects tokens.

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

## Connect Google Chat

**1. Set up your Google client**

Follow the [Google setup guide](https://onecli.sh/docs/integrations/google.md) once. Enable the **Google Chat API** in your Google Cloud project as part of it.

**2. Connect**

In the OneCLI dashboard, open **Connections** > **Google Chat** and click **Connect Google Chat**. Pick your Google account and click **Allow**.

![OneCLI connect window for Google Chat showing Configuration required, the setup guide link, and the Configure credentials button.](https://mintcdn.com/chartdbinc/L4k9tYUENUtEpMY8/images/integrations/google-chat/onecli-connect-google-chat.png?fit=max\&auto=format\&n=L4k9tYUENUtEpMY8\&q=85\&s=645a6b5ac4edff4c7e9b1e69b7f09302)

The Google Chat connect window in OneCLI before a Google client is set up.

## 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](https://onecli.sh/docs/guides/agent-access.md) 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](https://onecli.sh/docs/guides/rules.md) 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.