Agent skill

Google Workspace

by mitsuhiko in mitsuhiko/agent-stuff

Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP.

Apache-2.0Auto-check passedDocuments & Office

Install Google Workspace

skills CLI
$ npx skills add mitsuhiko/agent-stuff --skill google-workspace -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mitsuhiko/agent-stuff google-workspace --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mitsuhiko/agent-stuff.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/google-workspace .claude/skills/google-workspace && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
google-workspace
GitHub stars
3.2k
Token cost
~919 tokens
SKILL.md length
259 words
Files
6 (incl. scripts)
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP.

  • Works in 8 steps: Prefer one exec script per user request. → Keep payloads small (fields, maxResults,… → Use Promise.all for independent requests. → …
  • Tasks that involve Cloud office suites
  • SKILL.md covers Files, Account model (multi-account), Usage and Agent guidance, plus 3 more sections
  • Runs JavaScript scripts from its folder; calls node

What it does

Google Workspace is an agent skill from mitsuhiko/agent-stuff. Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP. Handles OAuth login and direct API calls.

Its SKILL.md is about 920 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `package-lock.json`, `package.json` and `scripts/auth.js`).

It sits in Documents & Office, covering Cloud office suites and Email management. It works with Google Workspace, Gmail and Model Context Protocol. The repository describes itself as: These are commands I use with agents, mostly Claude. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Cloud office suites
  • Tasks that involve Email management

Example prompts

  • “/google-workspace”

Requirements

  • Node.js

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Prefer one exec script per user request.
  2. Keep payloads small (fields, maxResults, minimal props).
  3. Use Promise.all for independent requests.
  4. Never print token contents.
  5. If the user did not specify an account, run node scripts/auth.js accounts and choose/confirm an explicit email.
  6. If auth fails, first run node scripts/auth.js accounts to see known profiles.
  7. If account mismatch is possible, run workspace.whoAmI() in the selected profile.
  8. On 401/403/unauthorized errors, switch account (--email ...) or re-login that specific profile.

What it can do on your machine

Read from SKILL.md and the folder at commit 0865c84. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Google Workspace loads about 919 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 259 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~919

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mitsuhiko/agent-stuff at commit 0865c84, republished under its Apache-2.0 licence (© mitsuhiko). 259 words, ~919 tokens.

Download SKILL.mdSave it as .claude/skills/google-workspace/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
google-workspace
description
Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP. Handles OAuth login and direct API calls.

Google Workspace

Use this skill for Google Workspace tasks (Gmail, Drive, Calendar, Docs, Sheets, etc.).

Files

  • scripts/auth.js — OAuth login/status/clear + account enumeration
  • scripts/workspace.js — JavaScript execution based API runner

Account model (multi-account)

This skill is profile-based by email address.

  • There is no default account.
  • Every API call must specify --email <account@example.com>.
  • Tokens are stored per-email under ~/.pi/google-workspace/tokens/.

Before running API calls, discover available signed-in accounts:

bash
node scripts/auth.js accounts

Usage

Always use exec and always provide --email.

bash
node scripts/workspace.js exec --email user@example.com <<'JS'
const me = await workspace.whoAmI();
const files = await workspace.call('drive', 'files.list', {
  pageSize: 5,
  fields: 'files(id,name,mimeType)',
});
return { me, files: files.files };
JS

Available inside exec scripts:

  • auth (authorized OAuth client)
  • google (googleapis root)
  • workspace.accountEmail (selected profile email)
  • workspace.call(service, methodPath, params, {version})
  • workspace.service(service, {version})
  • workspace.whoAmI()

Optional flags:

  • --timeout <ms> (default 30000, max 300000)
  • --scopes s1,s2
  • --script 'return 42'

Agent guidance

  1. Prefer one exec script per user request.
  2. Keep payloads small (fields, maxResults, minimal props).
  3. Use Promise.all for independent requests.
  4. Never print token contents.
  5. If the user did not specify an account, run node scripts/auth.js accounts and choose/confirm an explicit email.
  6. If auth fails, first run node scripts/auth.js accounts to see known profiles.
  7. If account mismatch is possible, run workspace.whoAmI() in the selected profile.
  8. On 401/403/unauthorized errors, switch account (--email ...) or re-login that specific profile.

Unauthorized/account-switch playbook

If a request fails with unauthorized/forbidden/insufficient permissions:

  1. Enumerate profiles:
bash
node scripts/auth.js accounts
  1. Retry with the intended account:
bash
node scripts/workspace.js exec --email correct-user@example.com <<'JS'
return await workspace.whoAmI();
JS
  1. If token is stale or missing scopes, re-login that account:
bash
node scripts/auth.js login --email correct-user@example.com
  1. Retry the original request with the same --email.

Short Gmail counting example

bash
node scripts/workspace.js exec --email user@example.com <<'JS'
const gmail = google.gmail({ version: 'v1', auth });

let trash = 0;
let pageToken;
do {
  const res = await gmail.users.messages.list({
    userId: 'me',
    q: 'in:trash',
    maxResults: 500,
    pageToken,
    fields: 'messages/id,nextPageToken',
  });
  trash += (res.data.messages || []).length;
  pageToken = res.data.nextPageToken;
} while (pageToken);

return { currentlyInTrash: trash };
JS

Setup + auth

bash
node scripts/auth.js login --email user@example.com

Notes:

  • Dependencies auto-install on first run.
  • Default auth mode is cloud (no local credentials.json needed).
  • Optional local mode: GOOGLE_WORKSPACE_AUTH_MODE=local and credentials at ~/.pi/google-workspace/credentials.json.
  • Useful diagnostics:
bash
node scripts/auth.js accounts
node scripts/auth.js status --email user@example.com
node scripts/auth.js clear --email user@example.com

© mitsuhiko, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts) in skills/google-workspace of mitsuhiko/agent-stuff.

  • SKILL.md
  • package-lock.json
  • package.json
  • scripts/auth.js
  • scripts/common.js
  • scripts/workspace.js

Open the folder on GitHubat commit 0865c84

Compare with similar skills

Google Workspace next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Google Workspace compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Google Workspace this skillmitsuhiko/agent-stuff3.2k—~919Automated safety check: PassApache-2.0
Managing Google Workspacetaylorwilsdon/google_workspace_mcp3.3k—~2.9kAutomated safety check: PassMIT
Google Workspaceswarmclawai/swarmclaw688—~680Automated safety check: PassMIT
Gwskv0906/pm-kit138—~1.6kAutomated safety check: PassMIT
Apple Mail Setupdavekilleen/Dex493—~2.5kAutomated safety check: PassMIT
Google Workspace CLIhoodini/ai-agents-skills282—~10kAutomated safety check: NotesNone

Similar skills

  • Managing Google Workspace

    taylorwilsdon/google_workspace_mcp

    Manages Google Workspace operations across 12 services (Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, Contacts, Chat, Apps Script, Custom Search).

    3.3k GitHub stars~2.9k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Google Workspace

    swarmclawai/swarmclaw

    Use Google Workspace CLI (gws) for Drive, Docs, Sheets, Gmail, Calendar, Chat, and related Workspace API tasks.

    688 GitHub stars~680 tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Gws

    kv0906/pm-kit

    This skill should be used when the user asks to "set up gws", "install Google Workspace CLI", "connect Gmail to Claude", "manage Google Drive from terminal", "send email from CLI", "check my…

    138 GitHub stars~1.6k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Apple Mail Setup

    davekilleen/Dex

    Set up and verify Apple Mail search on macOS, including the search index that silently returns nothing when it was never built.

    493 GitHub stars~2.5k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Google Workspace CLI

    hoodini/ai-agents-skills

    Interact with all Google Workspace APIs via the gws CLI. An agent skill from hoodini/ai-agents-skills.

    282 GitHub stars~10k tokensUpdated 2 mo ago
    Documents & OfficeAuto-check: notes
  • Gmail Query Syntax

    provos/ironcurtain

    Reference for Gmail's search query syntax — operators like is:sent, newerthan:, from:, has:attachment, label:, and how they compose.

    612 GitHub stars~971 tokensUpdated 2 days ago
    Productivity & AutomationAuto-check passed

More from mitsuhiko/agent-stuff

All 16 skills in this repo
  • Anachb

    mitsuhiko/agent-stuff

    Austrian public transport (VOR AnachB) for all of Austria. An agent skill from mitsuhiko/agent-stuff.

    3.2k GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Librarian

    mitsuhiko/agent-stuff

    Cache and refresh remote git repositories under ~/.cache/checkouts/<host/<org/<repo so future references can reuse a local copy.

    3.2k GitHub starsUsed in 1 repo~519 tokens
    Auto-check passed
  • Web Browser

    mitsuhiko/agent-stuff

    Automate and interact with web pages through Chrome or Chromium using the Chrome DevTools Protocol (CDP): navigate, click, fill forms, inspect content, take screenshots, and debug console or network…

    3.2k GitHub stars~1.5k tokensUpdated 11 days ago
    Auto-check: warnings
  • Oebb Scotty

    mitsuhiko/agent-stuff

    Austrian rail travel planner (ÖBB Scotty). An agent skill from mitsuhiko/agent-stuff.

    3.2k GitHub stars~2.4k tokensUpdated 11 days ago
    Auto-check passed
  • Sentry

    mitsuhiko/agent-stuff

    Fetch and analyze Sentry issues, events, transactions, and logs.

    3.2k GitHub stars~1.8k tokensUpdated 11 days ago
    Auto-check passed
  • Tmux

    mitsuhiko/agent-stuff

    Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.

    3.2k GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed

Questions about Google Workspace

What does Google Workspace do?

Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP. Google Workspace is an agent skill from mitsuhiko/agent-stuff. Access Google Workspace APIs (Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, People) via local helper scripts without MCP.

When should I use Google Workspace?

Google Workspace fits situations like: tasks that involve Cloud office suites; tasks that involve Email management.

How do I install Google Workspace in Claude Code?

Run `npx skills add mitsuhiko/agent-stuff --skill google-workspace -a claude-code`. Or copy the skill folder (skills/google-workspace in mitsuhiko/agent-stuff) into .claude/skills/google-workspace in your project. Claude Code loads it when a task matches its description.

How do I install Google Workspace in Codex?

Run `npx skills add mitsuhiko/agent-stuff --skill google-workspace -a codex`. Or copy the skill folder (skills/google-workspace in mitsuhiko/agent-stuff) into .agents/skills/google-workspace in your project. Codex loads it when a task matches its description.

Can I use Google Workspace in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mitsuhiko/agent-stuff --skill google-workspace -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/google-workspace, .gemini/skills/google-workspace, .github/skills/google-workspace and .opencode/skills/google-workspace in your project.

What does Google Workspace need to run?

Going by SKILL.md and its folder, Google Workspace needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js.

Does Google Workspace access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Google Workspace safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Google Workspace use?

Google Workspace is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Google Workspace use?

About 919 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Google Workspace?

Skills that share tags, products or a category with Google Workspace: Managing Google Workspace (taylorwilsdon/google_workspace_mcp, 3.3k stars), Google Workspace (swarmclawai/swarmclaw, 688 stars), Gws (kv0906/pm-kit, 138 stars) and Apple Mail Setup (davekilleen/Dex, 493 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Google Workspace?

mitsuhiko (a GitHub user) maintains it in mitsuhiko/agent-stuff, which has 3,179 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 27, 2026.

Source: mitsuhiko/agent-stuff on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.