ask-matt
MAmattpocock/skills336k4,217 new stars in the last 7 days
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.
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 <[email protected]>.~/.pi/google-workspace/tokens/.Before running API calls, discover available signed-in accounts:
node scripts/auth.js accounts
Always use exec and always provide --email.
node scripts/workspace.js exec --email [email protected] <<'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'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 accounts
node scripts/workspace.js exec --email [email protected] <<'JS'
return await workspace.whoAmI();
JS
node scripts/auth.js login --email [email protected]
--email.node scripts/workspace.js exec --email [email protected] <<'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
node scripts/auth.js login --email [email protected]
Notes:
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 [email protected]
node scripts/auth.js clear --email [email protected]
MAmattpocock/skills336k4,217 new stars in the last 7 days
MAmattpocock/skills336k4,217 new stars in the last 7 days
MAmattpocock/skills336k4,217 new stars in the last 7 days
OBobra/superpowers331k5,030 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days