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.
69
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Critical
Do not install without reviewing
Use this skill for Google Workspace tasks (Gmail, Drive, Calendar, Docs, Sheets, etc.).
scripts/auth.js — OAuth login/status/clear + account enumerationscripts/workspace.js — JavaScript execution based API runnerThis skill is profile-based by email address.
--email <account@example.com>.~/.pi/google-workspace/tokens/.Before running API calls, discover available signed-in accounts:
node scripts/auth.js accountsAlways use exec and always provide --email.
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 };
JSAvailable 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'exec script per user request.fields, maxResults, minimal props).Promise.all for independent requests.node scripts/auth.js accounts and choose/confirm an explicit email.node scripts/auth.js accounts to see known profiles.workspace.whoAmI() in the selected profile.--email ...) or re-login that specific profile.If a request fails with unauthorized/forbidden/insufficient permissions:
node scripts/auth.js accountsnode scripts/workspace.js exec --email correct-user@example.com <<'JS'
return await workspace.whoAmI();
JSnode scripts/auth.js login --email correct-user@example.com--email.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 };
JSnode scripts/auth.js login --email user@example.comNotes:
credentials.json needed).GOOGLE_WORKSPACE_AUTH_MODE=local and credentials at ~/.pi/google-workspace/credentials.json.node scripts/auth.js accounts
node scripts/auth.js status --email user@example.com
node scripts/auth.js clear --email user@example.comd265b8e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.