Skip to content
Google Workspace CLI: Gmail

Google Workspace CLI: Gmail Skill

Google Workspace's official gws skill for Gmail: send, read, triage, reply and forward email from an agent through the gws CLI, with the full Gmail v1 API one schema lookup away.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from googleworkspace/cli.

$ npx skills add googleworkspace/cli --skill gws-gmail

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/gws-gmail/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/googleworkspace/cli.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/gws-gmail ~/.claude/skills/gws-gmail

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/gws-gmail/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Helpers: +send, +triage, +reply, +reply-all, +forward, +read, +watch
  • Reply helpers handle Gmail threading automatically
  • +watch streams new messages as NDJSON
  • Full Gmail v1 users resource: drafts, labels, messages, threads, settings, history
  • Inspect any method with gws schema before calling it
  • Inherits auth and security rules from the shared gws skill

This is the Gmail skill from googleworkspace/cli, the official repository for gws, Google Workspace's single command-line tool for its APIs. It teaches an agent to work a Gmail mailbox through gws gmail <resource> <method> rather than hand-written HTTP calls.

Helper commands first. The skill points the agent at higher-level helpers before raw API calls: +send, +triage (an unread-inbox summary of sender, subject and date), +reply and +reply-all (which handle threading), +forward, +read (extract a message's body or headers) and +watch, which streams new mail as NDJSON. Each helper has its own skill in the same repository.

The whole API underneath. For anything the helpers do not cover, it lists the Gmail v1 users resource with its drafts, history, labels, messages, settings and threads sub-resources, plus profile and push-notification watch/stop. The rule it gives is to inspect before calling: gws gmail --help to browse, gws schema gmail.<resource>.<method> to read a method's required parameters and types, and then build --params and --json from that output.

Depends on the shared skill. Authentication, global flags and the security rules live in gws-shared, listed here as Google Workspace CLI (gws), and this skill tells the agent to read it first (or run gws generate-skills to create it). The gws binary must be installed.

Try it

Once installed, ask your agent something like:

gws gmail +triage
gws schema gmail.users.messages.list

SKILL.md

The instructions your agent loads, as published by Google Workspace.

SKILL.md
name
gws-gmail
description
Gmail: Send, read, and manage email.
metadata
version: 0.22.5 openclaw: category: "productivity" requires: bins: - gws cliHelp: "gws gmail --help"

gmail (v1)

PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
gws gmail <resource> <method> [flags]
Helper Commands
CommandDescription
[`+send`](../gws-gmail-send/SKILL.md)Send an email
[`+triage`](../gws-gmail-triage/SKILL.md)Show unread inbox summary (sender, subject, date)
[`+reply`](../gws-gmail-reply/SKILL.md)Reply to a message (handles threading automatically)
[`+reply-all`](../gws-gmail-reply-all/SKILL.md)Reply-all to a message (handles threading automatically)
[`+forward`](../gws-gmail-forward/SKILL.md)Forward a message to new recipients
[`+read`](../gws-gmail-read/SKILL.md)Read a message and extract its body or headers
[`+watch`](../gws-gmail-watch/SKILL.md)Watch for new emails and stream them as NDJSON
API Resources
users
  • getProfile — Gets the current user's Gmail profile.
  • stop — Stop receiving push notifications for the given user mailbox.
  • watch — Set up or update a push notification watch on the given user mailbox.
  • drafts — Operations on the 'drafts' resource
  • history — Operations on the 'history' resource
  • labels — Operations on the 'labels' resource
  • messages — Operations on the 'messages' resource
  • settings — Operations on the 'settings' resource
  • threads — Operations on the 'threads' resource
Discovering Commands

Before calling any API method, inspect it:

# Browse resources and methods
gws gmail --help

# Inspect a method's required params, types, and defaults
gws schema gmail.<resource>.<method>

Use gws schema output to build your --params and --json flags.

Install
Featured

Google's official skill for the gws CLI — drive Gmail, Drive, Calendar, Sheets, Docs, Chat and Admin APIs from an agent, with Model Armor screening.

Skill: Obsidian CLI

by Steph Ango (kepano)

Lets an agent drive a running Obsidian app through the official obsidian CLI: read, create, append to and search notes, manage tasks, properties and daily notes, and reload, debug and screenshot plugins and themes.

Browse all skills →