gws-chat — community gws-chat, workspace-cli, community, ide skills, Claude Code, Cursor, Windsurf

v2.2.0
GitHub

About this Skill

Perfect for AI Agents needing integrated Google Chat functionality with structured JSON output. Unofficial Google Workspaxce CLI

omriariav omriariav
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The gws-chat skill by omriariav is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for AI Agents needing integrated Google Chat functionality with structured JSON output.

Core Value

Empowers agents to interact with Google Chat via CLI, leveraging OAuth2 credentials for secure authentication and providing JSON output for seamless data integration with protocols like HTTP.

Capabilities Granted for gws-chat

Automating Google Chat messages with JSON data
Debugging chatbot interactions using CLI
Integrating Google Chat with other tools using JSON output

! Prerequisites & Limits

  • Requires OAuth2 credentials
  • Dependent on Google Chat API availability
  • Installation of gws CLI required via Go
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

gws-chat

Install gws-chat, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Google Chat (gws chat)

gws chat provides CLI access to Google Chat with structured JSON output.

Disclaimer: gws is not the official Google CLI. This is an independent, open-source project not endorsed by or affiliated with Google.

Dependency Check

Before executing any gws command, verify the CLI is installed:

bash
1gws version

If not found, install: go install github.com/omriariav/workspace-cli/cmd/gws@latest

Authentication

Requires OAuth2 credentials. Run gws auth status to check. If not authenticated: gws auth login (opens browser for OAuth consent). For initial setup, see the gws-auth skill.

Note: Google Chat API requires additional setup:

  1. Enable the Chat API in your Google Cloud project
  2. Configure the OAuth consent screen for Chat scopes
  3. For some operations, you may need a service account with domain-wide delegation

Quick Command Reference

TaskCommand
Spaces
List chat spacesgws chat list
List spaces (filtered)gws chat list --filter 'spaceType = "SPACE"'
Get space detailsgws chat get-space <space-id>
Create a spacegws chat create-space --display-name "Team" --type SPACE
Delete a spacegws chat delete-space <space-id>
Update a spacegws chat update-space <space-id> --display-name "New Name"
Search spaces (admin only)gws chat search-spaces --query "Engineering"
Find DM with usergws chat find-dm --user users/123
Create space + membersgws chat setup-space --display-name "Team" --members "users/1,users/2"
Create DMgws chat setup-space --type DIRECT_MESSAGE --members "users/123"
Create group chatgws chat setup-space --type GROUP_CHAT --members "users/1,users/2"
Build member cachegws chat build-cache
Find group by membersgws chat find-group --members "user1@example.com,user2@example.com"
Messages
Read messagesgws chat messages <space-id>
Read recent messagesgws chat messages <space-id> --order-by "createTime DESC" --max 10
Messages after a dategws chat messages <space-id> --after "2026-02-17T00:00:00Z"
Messages in a rangegws chat messages <space-id> --after "2026-02-17T00:00:00Z" --before "2026-02-20T00:00:00Z"
Send a messagegws chat send --space <space-id> --text "Hello"
Get a single messagegws chat get <message-name>
Update a messagegws chat update <message-name> --text "New text"
Delete a messagegws chat delete <message-name>
Members
List space membersgws chat members <space-id>
Get member detailsgws chat get-member <member-name>
Add a membergws chat add-member <space-id> --user users/123
Remove a membergws chat remove-member <member-name>
Update member rolegws chat update-member <member-name> --role ROLE_MANAGER
Reactions
List reactionsgws chat reactions <message-name>
Add a reactiongws chat react <message-name> --emoji "👍"
Remove a reactiongws chat unreact <reaction-name>
Read State
Get read stategws chat read-state <space-id>
Mark space as readgws chat mark-read <space-id>
Get thread read stategws chat thread-read-state <thread-name>
Attachments & Media
Get attachment infogws chat attachment <attachment-name>
Upload a filegws chat upload <space-id> --file ./report.pdf
Download mediagws chat download <resource-name> --output ./file.pdf
Events
List space eventsgws chat events <space-id> --filter 'event_types:"google.workspace.chat.message.v1.created"'
Get event detailsgws chat event <event-name>

Detailed Usage

list — List chat spaces

bash
1gws chat list [flags]

Lists all Chat spaces (rooms, DMs, group chats) you have access to. Supports filtering and pagination.

Flags:

  • --filter string — Filter spaces (e.g. spaceType = "SPACE")
  • --page-size int — Number of spaces per page (default 100)

messages — List messages in a space

bash
1gws chat messages <space-id> [flags]

Flags:

  • --max int — Maximum number of messages to return (default 25)
  • --after string — Show messages after this time (RFC3339, e.g. 2026-02-17T00:00:00Z)
  • --before string — Show messages before this time (RFC3339, e.g. 2026-02-20T00:00:00Z)
  • --filter string — Filter messages (e.g. createTime > "2024-01-01T00:00:00Z")
  • --order-by string — Order messages (e.g. createTime DESC)
  • --show-deleted — Include deleted messages in results

--after and --before are convenience shortcuts for --filter. They combine with --filter using AND.

members — List space members

bash
1gws chat members <space-id> [flags]

Lists all members of a Chat space with display names, emails, roles, and user types.

Display names and emails are auto-resolved via the People API and cached locally at ~/.config/gws/user-cache.json. The cache grows over time, avoiding repeat API calls.

Flags:

  • --max int — Maximum number of members to return (default 100)
  • --filter string — Filter members (e.g. member.type = "HUMAN")
  • --show-groups — Include Google Group memberships
  • --show-invited — Include invited memberships

send — Send a message

bash
1gws chat send --space <space-id> --text <message>

Flags:

  • --space string — Space ID or name (required)
  • --text string — Message text (required)

get — Get a single message

bash
1gws chat get <message-name>

Retrieves a single message by its resource name (e.g. spaces/AAAA/messages/msg1).

update — Update a message

bash
1gws chat update <message-name> --text "New text"

Flags:

  • --text string — New message text (required)

delete — Delete a message

bash
1gws chat delete <message-name> [flags]

Flags:

  • --force — Force delete even if message has replies

reactions — List reactions on a message

bash
1gws chat reactions <message-name> [flags]

Flags:

  • --filter string — Filter reactions (e.g. emoji.unicode = "😀")
  • --page-size int — Number of reactions per page (default 25)

react — Add a reaction

bash
1gws chat react <message-name> --emoji "👍"

Flags:

  • --emoji string — Emoji unicode character (required)

unreact — Remove a reaction

bash
1gws chat unreact <reaction-name>

Removes a reaction by its resource name (e.g. spaces/AAAA/messages/msg1/reactions/rxn1).

get-space — Get space details

bash
1gws chat get-space <space>

Retrieves details about a Chat space including name, type, description.

create-space — Create a space

bash
1gws chat create-space --display-name "Team Chat" [flags]

Flags:

  • --display-name string — Space display name (required)
  • --type string — Space type: SPACE or GROUP_CHAT (default SPACE)
  • --description string — Space description

delete-space — Delete a space

bash
1gws chat delete-space <space>

update-space — Update a space

bash
1gws chat update-space <space> [flags]

Flags:

  • --display-name string — New display name
  • --description string — New description

search-spaces — Search for spaces (admin only)

Requires Workspace admin privileges and chat.admin.spaces scope. Not available with regular user OAuth.

bash
1gws chat search-spaces --query "Engineering" [flags]

Flags:

  • --query string — Search query (required)
  • --page-size int — Results per page (default 100)

find-dm — Find direct message space

bash
1gws chat find-dm --user users/123

Flags:

  • --user string — User resource name or email (required, e.g. users/123 or users/user@example.com)

setup-space — Create space with members

bash
1# Named space with members 2gws chat setup-space --display-name "Project Team" --members "users/111,users/222" 3 4# Direct message (no display-name needed) 5gws chat setup-space --type DIRECT_MESSAGE --members "users/111" 6 7# Group chat (no display-name needed) 8gws chat setup-space --type GROUP_CHAT --members "users/111,users/222"

Flags:

  • --display-name string — Space display name (required for SPACE type, forbidden for DM/GROUP_CHAT)
  • --type string — Space type: SPACE, GROUP_CHAT, or DIRECT_MESSAGE (default SPACE)
  • --members string — Comma-separated user resource names (required for DM/GROUP_CHAT)

get-member — Get member details

bash
1gws chat get-member <member-name>

add-member — Add a member to a space

bash
1gws chat add-member <space> --user users/123 [flags]

Flags:

  • --user string — User resource name (required)
  • --role string — Member role: ROLE_MEMBER or ROLE_MANAGER (default ROLE_MEMBER)

remove-member — Remove a member

bash
1gws chat remove-member <member-name>

update-member — Update member role

bash
1gws chat update-member <member-name> --role ROLE_MANAGER

Flags:

  • --role string — New role: ROLE_MEMBER or ROLE_MANAGER (required)

read-state — Get space read state

bash
1gws chat read-state <space>

Returns when you last read the space. Space ID is auto-expanded to the full read state resource name.

mark-read — Mark space as read

bash
1gws chat mark-read <space> [flags]

Flags:

  • --time string — Read time in RFC-3339 format (defaults to now)

thread-read-state — Get thread read state

bash
1gws chat thread-read-state <thread-name>

Full resource name required (e.g. users/me/spaces/AAAA/threads/thread1/threadReadState).

attachment — Get attachment metadata

bash
1gws chat attachment <attachment-name>

Returns metadata: name, content_name, content_type, source, download_uri, thumbnail_uri.

upload — Upload a file

bash
1gws chat upload <space> --file ./report.pdf

Flags:

  • --file string — Path to file to upload (required)

download — Download media

bash
1gws chat download <resource-name> --output ./file.pdf

Flags:

  • --output string — Output file path (required)

events — List space events

bash
1gws chat events <space> --filter 'event_types:"google.workspace.chat.message.v1.created"' [flags]

Flags:

  • --filter string — Event type filter (required — API requires it)
  • --page-size int — Events per page (default 100)

event — Get event details

bash
1gws chat event <event-name>

build-cache — Build space-members cache

bash
1gws chat build-cache # Cache GROUP_CHAT spaces (default) 2gws chat build-cache --type all # Cache all space types 3gws chat build-cache --type SPACE # Cache only SPACE type

Iterates spaces, fetches members, resolves emails via People API, and stores a local cache at ~/.config/gws/space-members-cache.json. Progress is shown on stderr.

Flags:

  • --type string — Space type to cache: GROUP_CHAT (default), SPACE, DIRECT_MESSAGE, or all

find-group — Find group chats by members

bash
1gws chat find-group --members "alice@example.com,bob@example.com" 2gws chat find-group --members "alice@example.com" --refresh

Searches the local space-members cache for spaces where ALL specified emails are members. Requires build-cache to be run first (or use --refresh).

Flags:

  • --members string — Comma-separated email addresses to search for (required)
  • --refresh — Rebuild cache before searching

Output Modes

bash
1gws chat list --format json # Structured JSON (default) 2gws chat list --format yaml # YAML format 3gws chat list --format text # Human-readable text

Common Mistakes

MistakeCorrect Usage
--limit N on messagesUse --max N--limit does not exist
find-dm --user email@example.comUse users/email@example.com format — the --user flag requires a resource name prefix
setup-space --display-name "X" --type DIRECT_MESSAGEOmit --display-name for DM/GROUP_CHAT — API rejects it
find-group without cacheRun gws chat build-cache first, or use --refresh

Recipe: Find a Group Chat by Member Names

Preferred method — use the member cache:

bash
1# 1. Build the cache (one-time, or periodically) 2gws chat build-cache 3 4# 2. Search by email 5gws chat find-group --members "alice@example.com,bob@example.com" 6 7# 3. Get recent messages from the matched space 8gws chat messages spaces/AAAApznBCFA --after "2026-02-20T00:00:00Z" --order-by "createTime DESC" --max 25

Alternative — manual search (no cache needed):

bash
1# 1. List all spaces, filter to group chats 2gws chat list --format json | jq '.spaces | map(select(.type == "GROUP_CHAT")) | .[:10]' 3 4# 2. Check members of candidate spaces 5gws chat members spaces/AAAApznBCFA --format json

Key insight: DMs and group chats often have empty display_name — you must check members to identify participants.

Recipe: Create a DM via Contacts

bash
1# 1. Resolve email to user resource name 2gws contacts resolve --email "user@example.com" 3 4# 2. Check if DM already exists 5gws chat find-dm --user users/123456 6 7# 3. If not found, create the DM 8gws chat setup-space --type DIRECT_MESSAGE --members "users/123456" 9 10# 4. Send a message 11gws chat send --space spaces/DMXYZ --text "Hello!"

Tips for AI Agents

  • Always use --format json (the default) for programmatic parsing
  • Use gws chat list first to get space IDs
  • Space IDs are in the format spaces/AAAA1234
  • Message names are in the format spaces/AAAA/messages/msg1
  • members auto-resolves display names via People API — first call may be slower, subsequent calls use cache
  • Use --order-by "createTime DESC" with messages to get newest first
  • Use --filter 'createTime > "YYYY-MM-DDT00:00:00Z"' to scope messages to a date range — more reliable than relying on default ordering
  • read-state auto-expands bare space IDs (e.g. AAAAusers/me/spaces/AAAA/spaceReadState)
  • events requires a --filter with event types — see API docs
  • Chat API requires additional GCP setup beyond standard OAuth — see the gws-auth skill

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is gws-chat?

Perfect for AI Agents needing integrated Google Chat functionality with structured JSON output. Unofficial Google Workspaxce CLI

How do I install gws-chat?

Run the command: npx killer-skills add omriariav/workspace-cli/gws-chat. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for gws-chat?

Key use cases include: Automating Google Chat messages with JSON data, Debugging chatbot interactions using CLI, Integrating Google Chat with other tools using JSON output.

Which IDEs are compatible with gws-chat?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for gws-chat?

Requires OAuth2 credentials. Dependent on Google Chat API availability. Installation of gws CLI required via Go.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add omriariav/workspace-cli/gws-chat. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use gws-chat immediately in the current project.

Related Skills

Looking for an alternative to gws-chat or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI