Skip to content
Development
Skill

/google-workspace

Google OAuth2 client credentials (downloaded from Google Cloud Console)

From plugin
zorro-agent
1078 skills

Claude Code

$ npx -y skills add braxtonROSE4/zorro-agent --skill google-workspace --agent claude-code

SKILL.md

google-workspace.SKILL.md
name: google-workspace
description: Gmail, Calendar, Drive, Contacts, Sheets, and Docs integration via gws CLI (googleworkspace/cli). Uses OAuth2 with automatic token refresh via bridge script. Requires gws binary.
version: 2.0.0
author: Brax
license: MIT
required_credential_files:
  - path: google_token.json
    description: Google OAuth2 token (created by setup script)
  - path: google_client_secret.json
    description: Google OAuth2 client credentials (downloaded from Google Cloud Console)
metadata:
  zorro:
    tags: [Google, Gmail, Calendar, Drive, Sheets, Docs, Contacts, Email, OAuth, gws]
    homepage: https://github.com/NousResearch/zorro-agent
    related_skills: [himalaya]

Google Workspace

Gmail, Calendar, Drive, Contacts, Sheets, and Docs — powered by `gws` (Google's official Rust CLI). The skill provides a backward-compatible Python wrapper that handles OAuth token refresh and delegates to `gws`.

Architecture

google_api.py  →  gws_bridge.py  →  gws CLI
(argparse compat)  (token refresh)    (Google APIs)
  • `setup.py` handles OAuth2 (headless-compatible, works on CLI/Telegram/Discord)
  • `gws_bridge.py` refreshes the Zorro token and injects it into `gws` via `GOOGLE_WORKSPACE_CLI_TOKEN`
  • `google_api.py` provides the same CLI interface as v1 but delegates to `gws`

References

  • `references/gmail-search-syntax.md` — Gmail search operators (is:unread, from:, newer_than:, etc.)

Scripts

  • `scripts/setup.py` — OAuth2 setup (run once to authorize)
  • `scripts/gws_bridge.py` — Token refresh bridge to gws CLI
  • `scripts/google_api.py` — Backward-compatible API wrapper (delegates to gws)

Prerequisites

Install `gws`:

cargo install google-workspace-cli
# or via npm (recommended, downloads prebuilt binary):
npm install -g @googleworkspace/cli
# or via Homebrew:
brew install googleworkspace-cli

Verify: `gws --version`

First-Time Setup

The setup is fully non-interactive — you drive it step by step so it works on CLI, Telegram, Discord, or any platform.

Define a shorthand first:

ZORRO_HOME="${ZORRO_HOME:-$HOME/.zorro}"
GWORKSPACE_SKILL_DIR="$ZORRO_HOME/skills/productivity/google-workspace"
PYTHON_BIN="${ZORRO_PYTHON:-python3}"
if [ -x "$ZORRO_HOME/zorro-agent/venv/bin/python" ]; then
  PYTHON_BIN="$ZORRO_HOME/zorro-agent/venv/bin/python"
fi
GSETUP="$PYTHON_BIN $GWORKSPACE_SKILL_DIR/scripts/setup.py"

Step 0: Check if already set up

$GSETUP --check

If it prints `AUTHENTICATED`, skip to Usage — setup is already done.

Step 1: Triage — ask the user what they need

**Question 1: "What Google services do you need? Just email, or also Calendar/Drive/Sheets/Docs?"**

  • **Email only** → Use the `himalaya` skill instead — simpler setup.
  • **Calendar, Drive, Sheets, Docs (or email + these)** → Continue below.

**Partial scopes**: Users can authorize only a subset of services. The setup script accepts partial scopes and warns about missing ones.

**Question 2: "Does your Google account use Advanced Protection?"**

  • **No / Not sure** → Normal setup.
  • **Yes** → Workspace admin must add the OAuth client ID to allowed apps first.

Step 2: Create OAuth credentials (one-time, ~5 minutes)

Tell the user:

> 1. Go to https://console.cloud.google.com/apis/credentials > 2. Create a project (or use an existing one) > 3. Enable the APIs you need (Gmail, Calendar, Drive, Sheets, Docs, People) > 4. Credentials → Create Credentials → OAuth 2.0 Client ID → Desktop app > 5. Download JSON and tell me the file path

$GSETUP --client-secret /path/to/client_secret.json

Step 3: Get authorization URL

$GSETUP --auth-url

Send the URL to the user. After authorizing, they paste back the redirect URL or code.

Step 4: Exchange the code

$GSETUP --auth-code "THE_URL_OR_CODE_THE_USER_PASTED"

Step 5: Verify

$GSETUP --check

Should print `AUTHENTICATED`. Token refreshes automatically from now on.

Usage

All commands go through the API script:

ZORRO_HOME="${ZORRO_HOME:-$HOME/.zorro}"
GWORKSPACE_SKILL_DIR="$ZORRO_HOME/skills/productivity/google-workspace"
PYTHON_BIN="${ZORRO_PYTHON:-python3}"
if [ -x "$ZORRO_HOME/zorro-agent/venv/bin/python" ]; then
  PYTHON_BIN="$ZORRO_HOME/zorro-agent/venv/bin/python"
fi
GAPI="$PYTHON_BIN $GWORKSPACE_SKILL_DIR/scripts/google_api.py"

Gmail

$GAPI gmail search "is:unread" --max 10
$GAPI gmail get MESSAGE_ID
$GAPI gmail send --to user@example.com --subject "Hello" --body "Message text"
$GAPI gmail send --to user@example.com --subject "Report" --body "<h1>Q4</h1>" --html
$GAPI gmail reply MESSAGE_ID --body "Thanks, that works for me."
$GAPI gmail labels
$GAPI gmail modify MESSAGE_ID --add-labels LABEL_ID

Calendar

$GAPI calendar list
$GAPI calendar create --summary "Standup" --start 2026-03-01T10:00:00+01:00 --end 2026-03-01T10:30:00+01:00
$GAPI calendar create --summary "Review" --start ... --end ... --attendees "alice@co.com,bob@co.com"
$GAPI calendar delete EVENT_ID

Drive

$GAPI drive search "quarterly report" --max 10
$GAPI drive search "mimeType='application/pdf'" --raw-query --max 5

Contacts

$GAPI contacts list --max 20

Sheets

$GAPI sheets get SHEET_ID "Sheet1!A1:D10"
$GAPI sheets update SHEET_ID "Sheet1!A1:B2" --values '[["Name","Score"],["Alice","95"]]'
$GAPI sheets append SHEET_ID "Sheet1!A:C" --values '[["new","row","data"]]'

Docs

$GAPI docs get DOC_ID

Direct gws access (advanced)

For operations not covered by the wrapper, use `gws_bridge.py` directly:

GBRIDGE="$PYTHON_BIN $GWORKSPACE_SKILL_DIR/scripts/gws_bridge.py"
$GBRIDGE calendar +agenda --today --format table
$GBRIDGE gmail +triage --labels --format json
$GBRIDGE drive +upload ./report.pdf
$GBRIDGE sheets +read --spreadsheet SHEET_ID --range "Sheet1!A1:D10"

Output Format

All commands return JSON via `gws --format json`. Key output sha

Read more
@braxtonrose4
Ships withzorro-agent

A self-evolving CLI agent. Most agents treat memory as an afterthought — a flat text file that grows until it's useless.

Stars on GitHub

Momentum

stars in total
10
Star history of braxtonROSE4/zorro-agent on GitHub, a chart by star-history.com

Other skills on zorro-agent.

claude-code

claude-code

Delegate coding tasks to Claude Code (Anthropic's CLI agent). Use for building features, refactoring, PR reviews, and iterative…

codex

codex

Delegate coding tasks to OpenAI Codex CLI agent. Use for building features, refactoring, PR reviews, and batch issue fixing.…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about google-workspace.

Which coding agents can use google-workspace?
google-workspace installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.