Claude Skill

google-chat

Interact with Google Chat - send, read, edit, delete and react to messages, share images and files, reply in threads, and manage spaces and DMs. Use when user asks to: send a message on Google Chat, read chat messages, list chat spaces, find a chat room, send a DM, share a screen

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download sanjay3290-ai-skills-skills_google-chat-c842558.zip · 14 KB

Install

skills CLI npx skills add https://github.com/sanjay3290/ai-skills/tree/main/skills/google-chat
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sanjay3290-ai-skills@llmmart
Git git clone https://github.com/sanjay3290/ai-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole sanjay3290/ai-skills collection as a plugin from our marketplace. Git is the plain clone.

README

Google Chat Skill

An AI agent skill for interacting with Google Chat - send, read, edit and react to messages, share files, and manage spaces and DMs. Works with Claude Code, Gemini CLI, Cursor, OpenAI Codex, Goose, and other AI clients supporting the Agent Skills Standard.

Features

  • List & Find Spaces - View or search the spaces you're a member of
  • Send Messages - Post to any space, or DM a user directly
  • Read Messages - Compact conversation history, ~14x smaller than raw API output
  • Edit & Delete - Fix or remove messages you sent
  • Reactions - React to any message with an emoji
  • Threads - Reply inside an existing thread
  • Media - Send images, PDFs and other files, several at once
  • Members - List who is in a space
  • Aliases - Optional short names for the people and spaces you use daily
  • Dry Run - Preview any write as a request, without sending it
  • Create Spaces - Set up new spaces with members

Lightweight alternative to the full Google Workspace MCP server.

⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.

Quick Start

1. Install dependencies

pip install -r requirements.txt

2. Authenticate

python scripts/auth.py login

This opens a browser for Google OAuth. Tokens are stored securely in your system keyring.

3. Test connection

python scripts/auth.py status

Usage Examples

# Read a space (compact output; add --raw for full JSON)
python scripts/chat.py get-messages spaces/AAAA123 --limit 10

# Send a message, then fix it
python scripts/chat.py send-message spaces/AAAA123 "Hello team!"
python scripts/chat.py edit-message spaces/AAAA123/messages/XYZ "Hello team - corrected."

# React, reply in a thread, delete
python scripts/chat.py add-reaction spaces/AAAA123/messages/XYZ 👍
python scripts/chat.py reply-in-thread spaces/AAAA123 spaces/AAAA123/threads/T "Following up."
python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ

# Share files
python scripts/chat.py send-media spaces/AAAA123 "Latest mocks" --file a.png --file b.png

# Direct messages
python scripts/chat.py send-dm user@example.com "Hey, quick question..."

# Preview without sending
python scripts/chat.py --dry-run send-message spaces/AAAA123 "Not sent."

Command Reference

Global flags: --raw (full JSON instead of compact output), --dry-run (print the request instead of sending it).

Command Description Arguments
list-spaces List all spaces -
find-space <name> Find spaces by name (punctuation-insensitive) space name
list-members <space> List members of a space space
get-messages <space> Get messages from space space, --limit, --page-token
get-message <message> Get one message message name
list-threads <space> List threads space, --limit
send-message <space> <text> Send message space, text, --file
send-media <space> [text] Send files with optional caption space, --file (repeatable)
send-dm <email> <text> Send direct message user email, text, --file
reply-in-thread <space> <thread> <text> Reply in a thread space, thread, text
edit-message <message> <text> Edit a message you sent message name, new text
delete-message <message> Delete a message you sent message name, --force
add-reaction <message> <emoji> React to a message message name, emoji
find-dm <email> Find/create DM space user email
setup-space <name> [emails...] Create space name, member emails

Space and Message Name Formats

Google Chat uses spaces/AAAA123 for spaces and spaces/AAAA123/messages/XYZ for messages. Get space names from list-spaces or find-space; message names are returned by the send commands and listed by get-messages.

Optional Aliases

Copy directory.example.json to directory.json to map short names to the people and spaces you use daily:

{
  "users":  { "alex": "alex@example.com" },
  "spaces": { "team": { "id": "spaces/AAAAxxxxxxx", "name": "My Team" } }
}

send-message team "Deploying now" and send-dm alex "..." then resolve locally with no API call. directory.json is personal and gitignored; the feature is optional and full emails and IDs keep working without it.

Attachment Behaviour

Google Chat only accepts multiple attachments on a single message when all of them are images or videos. send-media splits a mixed batch (say a PNG and a PDF) into one message per file automatically, putting the caption on the first.

Token Management

Tokens stored securely using the system keyring:

  • macOS: Keychain
  • Windows: Windows Credential Locker
  • Linux: Secret Service API (GNOME Keyring, KDE Wallet)

Service name: google-chat-skill-oauth

Troubleshooting

"Failed to get access token"

Run python scripts/auth.py login to authenticate.

"Space not found"

Verify the space ID format (spaces/AAAA123). Use list-spaces to get valid IDs.

"Permission denied"

You may not be a member of the space. Check your Google Chat membership.

"You cannot edit/delete this message"

Only messages sent by the authenticated user can be edited or deleted.

"Can't create a message that contains multiple attachments..."

Chat allows several attachments on one message only when all are media. send-media handles this by splitting the batch; if you hit this calling the API directly, send the non-media files separately.

License

Apache 2.0

Skill manifest

Google Chat

Lightweight Google Chat integration with standalone OAuth authentication. No MCP server required.

⚠️ Requires Google Workspace account. Personal Gmail accounts are not supported.

Everything is sent as the authenticated user, so treat write commands as outward-facing: confirm the exact text with the user before posting to a space, and never send to a channel the user did not name.

First-Time Setup

pip install -r requirements.txt
python scripts/auth.py login     # opens browser
python scripts/auth.py status    # verify
python scripts/auth.py logout

Commands

All operations via scripts/chat.py. Auto-authenticates on first use if not logged in.

Reading

python scripts/chat.py get-messages spaces/AAAA123 --limit 10
python scripts/chat.py get-messages spaces/AAAA123 --limit 10 --raw   # full JSON
python scripts/chat.py get-message spaces/AAAA123/messages/XYZ
python scripts/chat.py list-threads spaces/AAAA123
python scripts/chat.py list-spaces
python scripts/chat.py find-space "Project Alpha"    # ignores punctuation/spacing
python scripts/chat.py list-members spaces/AAAA123

Read output is compact by default — one block per message with its timestamp, sender, text and resource name. That is roughly 14x smaller than the raw API payload, which matters when an agent is paying for every token it reads. Use --raw when you need the full JSON.

Writing

python scripts/chat.py send-message spaces/AAAA123 "Hello team!"
python scripts/chat.py send-dm user@example.com "Hey, quick question..."
python scripts/chat.py reply-in-thread spaces/AAAA123 spaces/AAAA123/threads/T "Following up."
python scripts/chat.py send-media spaces/AAAA123 "Latest mocks" --file a.png --file b.png
python scripts/chat.py edit-message spaces/AAAA123/messages/XYZ "Corrected text."
python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ
python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ --force   # has thread replies
python scripts/chat.py add-reaction spaces/AAAA123/messages/XYZ 👍
python scripts/chat.py setup-space "New Project" user1@example.com user2@example.com
python scripts/chat.py find-dm user@example.com

Add --dry-run to any write command to print the request instead of sending it. Use it when wiring up or testing a flow so nothing lands in a real channel. (For send-dm it reports the resolved recipient rather than the DM space, since resolving that needs a live call.)

Editing and deleting

send-message, send-dm and send-media return the created message's name (spaces/X/messages/Y) — that is what edit-message, delete-message and add-reaction take. You can only edit or delete messages you sent. To fix an older message, find its name with get-messages first.

Attachments

send-media takes a repeatable --file. Google Chat accepts several attachments on one message only when every attachment is media (image or video); a mixed batch is split automatically into one message per file, with the caption on the first. --attachment is still accepted as an alias for a single --file.

Optional aliases

Typing full email addresses and spaces/AAAA... IDs is tedious, and having an agent call list-spaces to find a channel it uses daily is slow. Copy directory.example.json to directory.json and map short names:

{
  "users":  { "alex": "alex@example.com" },
  "spaces": { "team": { "id": "spaces/AAAAxxxxxxx", "name": "My Team" } }
}

Then send-message team "Deploying now" and send-dm alex "..." both resolve locally, with no API call. Full emails and spaces/... names keep working everywhere.

directory.json is personal and gitignored. It is entirely optional — without it every command still works, and an unresolvable alias fails immediately with the list of valid ones rather than silently falling back to a scan.

Message formatting

Chat supports *bold*, _italic_, ~strike~, `code`, triple-backtick code blocks, and <url|label> links. It does not support Markdown headings, tables, or []( ) links — they render literally.

Token Management

Tokens stored securely using the system keyring:

  • macOS: Keychain
  • Windows: Windows Credential Locker
  • Linux: Secret Service API (GNOME Keyring, KDE Wallet, etc.)

Service name: google-chat-skill-oauth. Expired tokens refresh automatically.

Files (ai-skills)
  • scripts
    • auth.py 12.8 KB
      Loading…
    • chat.py 19.1 KB
      Loading…
  • .gitignore 34 B · in bundle
  • directory.example.json 488 B
    Loading…
  • README.md 5.6 KB
    # Google Chat Skill
    
    An AI agent skill for interacting with Google Chat - send, read, edit and react to messages, share files, and manage spaces and DMs. Works with Claude Code, Gemini CLI, Cursor, OpenAI Codex, Goose, and other AI clients supporting the [Agent Skills Standard](https://agentskills.io).
    
    ## Features
    
    - **List & Find Spaces** - View or search the spaces you're a member of
    - **Send Messages** - Post to any space, or DM a user directly
    - **Read Messages** - Compact conversation history, ~14x smaller than raw API output
    - **Edit & Delete** - Fix or remove messages you sent
    - **Reactions** - React to any message with an emoji
    - **Threads** - Reply inside an existing thread
    - **Media** - Send images, PDFs and other files, several at once
    - **Members** - List who is in a space
    - **Aliases** - Optional short names for the people and spaces you use daily
    - **Dry Run** - Preview any write as a request, without sending it
    - **Create Spaces** - Set up new spaces with members
    
    Lightweight alternative to the full [Google Workspace MCP server](https://github.com/gemini-cli-extensions/workspace).
    
    > **⚠️ Requires Google Workspace account.** Personal Gmail accounts are not supported.
    
    ## Quick Start
    
    ### 1. Install dependencies
    
    ```bash
    pip install -r requirements.txt
    ```
    
    ### 2. Authenticate
    
    ```bash
    python scripts/auth.py login
    ```
    
    This opens a browser for Google OAuth. Tokens are stored securely in your system keyring.
    
    ### 3. Test connection
    
    ```bash
    python scripts/auth.py status
    ```
    
    ## Usage Examples
    
    ```bash
    # Read a space (compact output; add --raw for full JSON)
    python scripts/chat.py get-messages spaces/AAAA123 --limit 10
    
    # Send a message, then fix it
    python scripts/chat.py send-message spaces/AAAA123 "Hello team!"
    python scripts/chat.py edit-message spaces/AAAA123/messages/XYZ "Hello team - corrected."
    
    # React, reply in a thread, delete
    python scripts/chat.py add-reaction spaces/AAAA123/messages/XYZ 👍
    python scripts/chat.py reply-in-thread spaces/AAAA123 spaces/AAAA123/threads/T "Following up."
    python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ
    
    # Share files
    python scripts/chat.py send-media spaces/AAAA123 "Latest mocks" --file a.png --file b.png
    
    # Direct messages
    python scripts/chat.py send-dm user@example.com "Hey, quick question..."
    
    # Preview without sending
    python scripts/chat.py --dry-run send-message spaces/AAAA123 "Not sent."
    ```
    
    ## Command Reference
    
    Global flags: `--raw` (full JSON instead of compact output), `--dry-run` (print the request instead of sending it).
    
    | Command | Description | Arguments |
    |---------|-------------|-----------|
    | `list-spaces` | List all spaces | - |
    | `find-space <name>` | Find spaces by name (punctuation-insensitive) | space name |
    | `list-members <space>` | List members of a space | space |
    | `get-messages <space>` | Get messages from space | space, `--limit`, `--page-token` |
    | `get-message <message>` | Get one message | message name |
    | `list-threads <space>` | List threads | space, `--limit` |
    | `send-message <space> <text>` | Send message | space, text, `--file` |
    | `send-media <space> [text]` | Send files with optional caption | space, `--file` (repeatable) |
    | `send-dm <email> <text>` | Send direct message | user email, text, `--file` |
    | `reply-in-thread <space> <thread> <text>` | Reply in a thread | space, thread, text |
    | `edit-message <message> <text>` | Edit a message you sent | message name, new text |
    | `delete-message <message>` | Delete a message you sent | message name, `--force` |
    | `add-reaction <message> <emoji>` | React to a message | message name, emoji |
    | `find-dm <email>` | Find/create DM space | user email |
    | `setup-space <name> [emails...]` | Create space | name, member emails |
    
    ## Space and Message Name Formats
    
    Google Chat uses `spaces/AAAA123` for spaces and `spaces/AAAA123/messages/XYZ` for messages. Get space names from `list-spaces` or `find-space`; message names are returned by the send commands and listed by `get-messages`.
    
    ## Optional Aliases
    
    Copy `directory.example.json` to `directory.json` to map short names to the people and spaces you use daily:
    
    ```json
    {
      "users":  { "alex": "alex@example.com" },
      "spaces": { "team": { "id": "spaces/AAAAxxxxxxx", "name": "My Team" } }
    }
    ```
    
    `send-message team "Deploying now"` and `send-dm alex "..."` then resolve locally with no API call. `directory.json` is personal and gitignored; the feature is optional and full emails and IDs keep working without it.
    
    ## Attachment Behaviour
    
    Google Chat only accepts multiple attachments on a single message when all of them are images or videos. `send-media` splits a mixed batch (say a PNG and a PDF) into one message per file automatically, putting the caption on the first.
    
    ## Token Management
    
    Tokens stored securely using the system keyring:
    - **macOS**: Keychain
    - **Windows**: Windows Credential Locker
    - **Linux**: Secret Service API (GNOME Keyring, KDE Wallet)
    
    Service name: `google-chat-skill-oauth`
    
    ## Troubleshooting
    
    ### "Failed to get access token"
    Run `python scripts/auth.py login` to authenticate.
    
    ### "Space not found"
    Verify the space ID format (`spaces/AAAA123`). Use `list-spaces` to get valid IDs.
    
    ### "Permission denied"
    You may not be a member of the space. Check your Google Chat membership.
    
    ### "You cannot edit/delete this message"
    Only messages sent by the authenticated user can be edited or deleted.
    
    ### "Can't create a message that contains multiple attachments..."
    Chat allows several attachments on one message only when all are media. `send-media` handles this by splitting the batch; if you hit this calling the API directly, send the non-media files separately.
    
    ## License
    
    Apache 2.0
    
  • requirements.txt 33 B
    Loading…
  • SKILL.md 4.9 KB
    ---
    name: google-chat
    description: |
      Interact with Google Chat - send, read, edit, delete and react to messages, share images
      and files, reply in threads, and manage spaces and DMs. Use when user asks to: send a
      message on Google Chat, read chat messages, list chat spaces, find a chat room, send a DM,
      share a screenshot or file, edit or delete something already sent, or create a new space.
      Lightweight alternative to full Google Workspace MCP server with standalone OAuth authentication.
    license: Apache-2.0
    metadata:
      author: sanjay3290
      version: "1.1"
    ---
    
    # Google Chat
    
    Lightweight Google Chat integration with standalone OAuth authentication. No MCP server required.
    
    > **⚠️ Requires Google Workspace account.** Personal Gmail accounts are not supported.
    
    Everything is sent as the authenticated user, so treat write commands as outward-facing:
    confirm the exact text with the user before posting to a space, and never send to a channel
    the user did not name.
    
    ## First-Time Setup
    
    ```bash
    pip install -r requirements.txt
    python scripts/auth.py login     # opens browser
    python scripts/auth.py status    # verify
    python scripts/auth.py logout
    ```
    
    ## Commands
    
    All operations via `scripts/chat.py`. Auto-authenticates on first use if not logged in.
    
    ### Reading
    
    ```bash
    python scripts/chat.py get-messages spaces/AAAA123 --limit 10
    python scripts/chat.py get-messages spaces/AAAA123 --limit 10 --raw   # full JSON
    python scripts/chat.py get-message spaces/AAAA123/messages/XYZ
    python scripts/chat.py list-threads spaces/AAAA123
    python scripts/chat.py list-spaces
    python scripts/chat.py find-space "Project Alpha"    # ignores punctuation/spacing
    python scripts/chat.py list-members spaces/AAAA123
    ```
    
    Read output is compact by default — one block per message with its timestamp, sender, text
    and resource name. That is roughly 14x smaller than the raw API payload, which matters when
    an agent is paying for every token it reads. Use `--raw` when you need the full JSON.
    
    ### Writing
    
    ```bash
    python scripts/chat.py send-message spaces/AAAA123 "Hello team!"
    python scripts/chat.py send-dm user@example.com "Hey, quick question..."
    python scripts/chat.py reply-in-thread spaces/AAAA123 spaces/AAAA123/threads/T "Following up."
    python scripts/chat.py send-media spaces/AAAA123 "Latest mocks" --file a.png --file b.png
    python scripts/chat.py edit-message spaces/AAAA123/messages/XYZ "Corrected text."
    python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ
    python scripts/chat.py delete-message spaces/AAAA123/messages/XYZ --force   # has thread replies
    python scripts/chat.py add-reaction spaces/AAAA123/messages/XYZ 👍
    python scripts/chat.py setup-space "New Project" user1@example.com user2@example.com
    python scripts/chat.py find-dm user@example.com
    ```
    
    Add `--dry-run` to any write command to print the request instead of sending it. Use it when
    wiring up or testing a flow so nothing lands in a real channel. (For `send-dm` it reports the
    resolved recipient rather than the DM space, since resolving that needs a live call.)
    
    ## Editing and deleting
    
    `send-message`, `send-dm` and `send-media` return the created message's `name`
    (`spaces/X/messages/Y`) — that is what `edit-message`, `delete-message` and `add-reaction`
    take. You can only edit or delete messages **you** sent. To fix an older message, find its
    name with `get-messages` first.
    
    ## Attachments
    
    `send-media` takes a repeatable `--file`. Google Chat accepts several attachments on one
    message only when every attachment is media (image or video); a mixed batch is split
    automatically into one message per file, with the caption on the first. `--attachment` is
    still accepted as an alias for a single `--file`.
    
    ## Optional aliases
    
    Typing full email addresses and `spaces/AAAA...` IDs is tedious, and having an agent call
    `list-spaces` to find a channel it uses daily is slow. Copy `directory.example.json` to
    `directory.json` and map short names:
    
    ```json
    {
      "users":  { "alex": "alex@example.com" },
      "spaces": { "team": { "id": "spaces/AAAAxxxxxxx", "name": "My Team" } }
    }
    ```
    
    Then `send-message team "Deploying now"` and `send-dm alex "..."` both resolve locally, with
    no API call. Full emails and `spaces/...` names keep working everywhere.
    
    `directory.json` is personal and gitignored. It is entirely optional — without it every
    command still works, and an unresolvable alias fails immediately with the list of valid ones
    rather than silently falling back to a scan.
    
    ## Message formatting
    
    Chat supports `*bold*`, `_italic_`, `~strike~`, `` `code` ``, triple-backtick code blocks, and
    `<url|label>` links. It does **not** support Markdown headings, tables, or `[](  )` links —
    they render literally.
    
    ## Token Management
    
    Tokens stored securely using the system keyring:
    - **macOS**: Keychain
    - **Windows**: Windows Credential Locker
    - **Linux**: Secret Service API (GNOME Keyring, KDE Wallet, etc.)
    
    Service name: `google-chat-skill-oauth`. Expired tokens refresh automatically.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.