agentleFS
pbc-ospbc-os/smb-starter-kit/skills/tier-1-foundation/google-workspace/SKILL.md

google-workspace

Skill10 starsChanged 7 months agoMITView on GitHub

Set up the gws CLI to give your agent access to Gmail, Calendar, Drive, Sheets, Docs, Chat, Tasks, and every Google Workspace API. Foundation skill that enables all Google-powered communication, business ops, and automation skills.

  • Reads credentials
  • Installs packages

We split this skill into the rules it gives an agent

14 rules. 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 43 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a project (or use an existing one)

    line 87
  2. Distinctive:

    Add your email under Test users

    line 91
  3. Distinctive:

    Create an OAuth client (type: Desktop app)

    line 92
  4. Very specific:

    Recommended for SMBs: Start with gmail,calendar,drive,sheets — this covers 90% of small business needs.

    line 117
  5. Very specific:

    If another tool (e.g., gcloud) already manages tokens:

    line 141
  6. Distinctive:

    After auth, test each service you enabled:

    line 149
  7. Very specific:

    Prefer --dry-run for destructive operations

    line 244
  8. Very specific:

    Use --format json for programmatic processing — don't parse table output

    line 245
  9. Very specific:

    Use -s service1,service2 to select only what you need

    line 267
  10. Very specific:

    Ensure Node.js 18+ is installed: node --version

    line 271
  11. Very specific:

    Check your PATH includes npm global bin: npm config get prefix

    line 273
  12. Very specific:

    Use --page-delay <MS> to slow down pagination

    line 276
  13. Very specific:

    Use --page-limit <N> to cap pages

    line 277
  14. Distinctive:

    After setup, install the skills that match your needs:

    line 282

“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google Workspace

Give your agent access to all of Google Workspace through one CLI.

This skill sets up gws — a command-line tool that wraps every Google Workspace API (Gmail, Calendar, Drive, Sheets, Docs, Chat, Tasks, Meet, Forms, and more). It outputs structured JSON, making it ideal for AI agents.

Attribution: The gws CLI was created by Justin Poehnelt, Developer Relations Engineer at Google. It's the foundation that makes the entire Google Workspace skill tier possible.

gws doesn't ship a static list of commands. It reads Google's Discovery Service at runtime and builds its command surface dynamically. When Google adds an API endpoint, gws picks it up automatically.

Triggers

  • "set up google workspace"
  • "connect gmail / calendar / drive / sheets"
  • "install gws"
  • "I need to read my email"
  • "I need to manage my calendar"
  • Any request that requires Google Workspace access and gws isn't installed yet

What This Enables

Once gws is set up, these skills become available:

TierSkillWhat It Does
2gmailSend, read, triage, reply, forward email
2google-calendarManage events, check availability, meeting prep
2google-chatSend messages to Google Chat spaces
3google-driveManage files, folders, shared drives
3google-sheetsRead, write, create spreadsheets
3google-docsCreate and edit documents
3google-tasksManage task lists and to-dos
5morning-briefingDaily digest combining email, calendar, and business data

Prerequisites

  • Node.js 18+ — check with node --version
  • A Google Cloud project — gws auth setup can create one, or use an existing project
  • A Google account with access to Google Workspace (works with personal Gmail too)

Installation

Option 1: npm (recommended)

npm install -g @googleworkspace/cli

Option 2: Pre-built binary

Download from GitHub Releases.

Option 3: Build from source

cargo install --git https://github.com/googleworkspace/cli --locked

Verify installation

gws --version

Authentication

Fastest Path (if you have gcloud)

gws auth setup     # Creates Cloud project, enables APIs, logs you in

This is the recommended path. It handles everything in one command.

If you don't have gcloud

  1. Go to Google Cloud Console
  2. Create a project (or use an existing one)
  3. Go to APIs & Services → Credentials
  4. Configure OAuth consent screen:
    • App type: External (testing mode is fine)
    • Add your email under Test users
  5. Create an OAuth client (type: Desktop app)
  6. Download the client JSON → save as ~/.config/gws/client_secret.json
  7. Run:
    gws auth login

Scope Selection

Google limits unverified apps to ~25 scopes. Don't select all — pick what you need:

# Just email
gws auth login -s gmail

# Email + calendar
gws auth login -s gmail,calendar

# Email + calendar + drive + sheets
gws auth login -s gmail,calendar,drive,sheets

# Common SMB setup (email, calendar, drive, sheets, docs, tasks, chat)
gws auth login -s gmail,calendar,drive,sheets,docs,tasks,chat

Recommended for SMBs: Start with gmail,calendar,drive,sheets — this covers 90% of small business needs. Add more services later with another gws auth login -s <additional-services>.

Headless / Server / CI

  1. Complete interactive auth on a machine with a browser
  2. Export credentials:
    gws auth export --unmasked > credentials.json
  3. On the headless machine:
    export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/credentials.json
    gws drive files list   # just works

Service Account (server-to-server)

export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/service-account.json
gws drive files list

Using an existing token

If another tool (e.g., gcloud) already manages tokens:

export GOOGLE_WORKSPACE_CLI_TOKEN=$(gcloud auth print-access-token)

Verify Everything Works

After auth, test each service you enabled:

# Gmail — show unread count
gws gmail +triage --max 3

# Calendar — today's events
gws calendar +agenda

# Drive — list recent files
gws drive files list --params '{"pageSize": 5}'

# Sheets — list spreadsheets
gws drive files list --params '{"q": "mimeType=\"application/vnd.google-apps.spreadsheet\"", "pageSize": 5}'

CLI Patterns

Global Flags

FlagDescription
--format <FORMAT>json (default), table, yaml, csv
--dry-runPreview without calling the API
--page-allAuto-paginate (NDJSON output)
--page-limit <N>Max pages (default: 10)

Command Structure

gws <service> <resource> <method> [flags]
gws <service> +<helper-command> [flags]

Discovering Commands

# What services are available?
gws --help

# What can I do with gmail?
gws gmail --help

# What parameters does this method take?
gws schema gmail.users.messages.list

# Preview a request without executing
gws gmail users messages list --params '{"maxResults": 5}' --dry-run

Helper Commands (shortcuts)

gws includes high-level helper commands prefixed with + that simplify common tasks:

gws gmail +triage           # Unread inbox summary
gws gmail +send             # Send an email
gws gmail +reply            # Reply to a message
gws calendar +agenda        # Today's events
gws calendar +insert        # Create an event
gws drive +upload            # Upload a file
gws sheets +read             # Read spreadsheet values
gws sheets +append           # Append a row
gws workflow +standup-report # Today's meetings + tasks
gws workflow +meeting-prep   # Prep for next meeting
gws workflow +weekly-digest  # Week summary

Built-in Workflows

gws includes cross-service workflows that combine multiple APIs:

gws workflow +standup-report    # Calendar agenda + open tasks
gws workflow +meeting-prep      # Attendees + agenda + linked docs
gws workflow +weekly-digest     # Week's meetings + unread count
gws workflow +email-to-task     # Convert email → task
gws workflow +file-announce     # Share Drive file in Chat

Built-in Recipes (40+)

For common multi-step operations:

# See all available recipes
gws --help | grep recipe

Examples: batch-invite-to-event, create-gmail-filter, find-large-files, save-email-attachments, create-doc-from-template, sync-contacts-to-sheet, and many more.

Security Rules

  • Never output secrets (API keys, tokens) directly
  • Always confirm with the user before executing write/delete commands
  • Prefer --dry-run for destructive operations
  • Use --format json for programmatic processing — don't parse table output
  • Credentials are encrypted at rest (AES-256-GCM) with OS keyring

Credential Storage

MethodWhere StoredBest For
Interactive OAuth~/.config/gws/ (encrypted)Local development, personal use
Service AccountWherever you put the JSON keyServers, CI/CD, automation
Environment variableGOOGLE_WORKSPACE_CLI_TOKENShort-lived sessions
Exported credentialsYour chosen pathHeadless servers

For production/server use, consider storing the service account key or exported credentials in your secrets manager (see secrets-manager skill).

Troubleshooting

"Access blocked" on login

  • You need to add your email as a Test user in the OAuth consent screen
  • Go to: Google Cloud Console → APIs & Services → OAuth consent screen → Test users → Add

Scope errors

  • Your app may be in testing mode with limited scopes
  • Use -s service1,service2 to select only what you need
  • Or publish the app for broader scope access

"gws: command not found"

  • Ensure Node.js 18+ is installed: node --version
  • Try: npx @googleworkspace/cli --version
  • Check your PATH includes npm global bin: npm config get prefix

Rate limits

  • Use --page-delay <MS> to slow down pagination
  • Use --page-limit <N> to cap pages
  • For bulk operations, add delays between calls

What's Next

After setup, install the skills that match your needs:

  • Need email management? → gmail skill
  • Need scheduling? → google-calendar skill
  • Need file management? → google-drive skill
  • Need reporting/tracking? → google-sheets skill
  • Want a daily briefing? → morning-briefing skill

Related Skills

  • secrets-manager — Store gws credentials securely for server deployments
  • gmail — Email management for SMBs
  • google-calendar — Calendar management for SMBs
  • google-drive — File management for SMBs
  • google-sheets — Spreadsheet operations for SMBs
  • morning-briefing — Daily digest combining all Google Workspace data

Powered by gws by Justin Poehnelt — one CLI for all of Google Workspace.

Download now (ZIP)

  • Other versions47 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 47

    1. NousResearch/hermes-agent★ 259ksame name
    2. google/adk-recipes★ 11ksame name
    3. google/adk-samples★ 11ksame name
    4. mitsuhiko/agent-commands★ 3.2ksame name
    5. mitsuhiko/agent-stuff★ 3.2ksame name
    6. math-inc/OpenGauss★ 1.3ksame name
    7. Tommy-yw/RunbookHermes★ 546same name
    8. aivrar/portable-hermes-agent★ 239same name
    9. RedWoodOG/Hermes-Desktop★ 177same name
    10. HybridAIOne/hybridclaw★ 159same name

    37 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use heartmula, jupyter-live-kernel and 10 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • math-incSkill

      heartmula

      Set up and run HeartMuLa, the open-source music generation model family (Suno-like). Generates full songs from lyrics + tags with multilingual support.

      Also in 6 projects that use this

    • math-incSkill

      jupyter-live-kernel

      Use a live Jupyter kernel for stateful, iterative Python execution via hamelnb. Load this skill when the task involves exploration, iteration, or inspecting intermediate results — data science, ML experimentation, API exploration, or building up complex code step-by-step. Uses terminal to run CLI commands against a live Jupyter kernel. No new tools required.

      Also in 5 projects that use this

    • Tommy-ywSkill

      songwriting-and-ai-music

      Songwriting craft, AI music generation prompts (Suno focus), parody/adaptation techniques, phonetic tricks, and lessons learned. These are tools and ideas, not rules. Break any of them when the art calls for it.

      Also in 7 projects that use this

    • john-data-chenSkill

      teams-meeting-pipeline

      Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.

      Also in 5 projects that use this

    • Tommy-ywSkill

      maps

      Location intelligence — geocode a place, reverse-geocode coordinates, find nearby places (46 POI categories), driving/walking/cycling distance + time, turn-by-turn directions, timezone lookup, bounding box + area for a named place, and POI search within a rectangle. Uses OpenStreetMap + Overpass + OSRM. Free, no API key.

      Also in 8 projects that use this

    • emanueleieloSkill

      imessage

      Send and read iMessage/SMS via Messages.app using the imsg CLI. List chats, view history, send messages to phone numbers or Apple IDs.

      Also in 11 projects that use this

    • +5 more from math-inc
  • In this repository23 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.