Agent skill
google-workspace
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.
Install this agent skill to your Project
npx add-skill https://github.com/mitsuhiko/agent-stuff/tree/main/skills/google-workspace
SKILL.md
Google Workspace
Use this skill for Google Workspace tasks (Gmail, Drive, Calendar, Docs, Sheets, etc.).
Files
scripts/auth.js— OAuth login/status/clearscripts/workspace.js— JavaScript execution based API runner
Usage
Always use exec.
node scripts/workspace.js exec <<'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(googleapisroot)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
- Prefer one
execscript per user request. - Keep payloads small (
fields,maxResults, minimal props). - Use
Promise.allfor independent requests. - Never print token contents.
- Use
scripts/auth.jsif you get auth errors.
Short Gmail counting example
node scripts/workspace.js exec <<'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
node scripts/auth.js login
Notes:
- Dependencies auto-install on first run.
- Default auth mode is cloud (no local
credentials.jsonneeded). - Optional local mode:
GOOGLE_WORKSPACE_AUTH_MODE=localand credentials at~/.pi/google-workspace/credentials.json. - Useful diagnostics:
node scripts/auth.js status
node scripts/auth.js clear
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
update-changelog
Read this skill before updating changelogs
web-browser
Allows to interact with web pages by performing actions such as clicking buttons, filling out forms, and navigating links. It works by remote controlling Google Chrome or Chromium browsers using the Chrome DevTools Protocol (CDP). When Claude needs to browse the web, it can use this skill to do so.
summarize
Fetch a URL or convert a local file (PDF/DOCX/HTML/etc.) into Markdown using `uvx markitdown`, optionally it can summarize
commit
Read this skill before making git commits
anachb
Austrian public transport (VOR AnachB) for all of Austria. Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions. Use when asking about Austrian trains, buses, trams, metro (U-Bahn), or directions involving public transport in Austria.
tmux
Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.
Didn't find tool you were looking for?