Google Workspace (No MCP)
Use this skill when the user wants Google Workspace access in pi without MCP.
This skill provides local Node.js helper scripts for:
- OAuth login + token management
- Direct Google API calls (generic and convenience commands)
Files
scripts/auth.js— login/status/clear tokenscripts/workspace.js— call APIsscripts/common.js— shared auth logic
One-time setup
- Dependencies auto-install on first script run (
auth.jsorworkspace.js).
Optional (to prewarm manually):
cd /Users/mitsuhiko/Development/agent-stuff/skills/google-workspace
npm install
- Auth mode defaults to cloud (same hosted OAuth approach used by the workspace extension), so no local
credentials.jsonis required.
Optional local OAuth mode:
- Set
GOOGLE_WORKSPACE_AUTH_MODE=local - Create a Google OAuth Desktop app and place credentials at:
~/.pi/google-workspace/credentials.json
Environment overrides:
GOOGLE_WORKSPACE_CONFIG_DIRGOOGLE_WORKSPACE_CREDENTIALSGOOGLE_WORKSPACE_TOKENGOOGLE_WORKSPACE_AUTH_MODE(cloudorlocal)GOOGLE_WORKSPACE_CLIENT_ID(cloud mode)GOOGLE_WORKSPACE_CLOUD_FUNCTION_URL(cloud mode)
Authenticate
cd /Users/mitsuhiko/Development/agent-stuff/skills/google-workspace
node scripts/auth.js login
This opens the browser for OAuth consent automatically.
If you run an API call without a token, workspace.js will also trigger the same browser auth flow.
Check auth status:
node scripts/auth.js status
Clear token:
node scripts/auth.js clear
API usage
Generic API call
node scripts/workspace.js call <service> <method.path> '<json params>'
Examples:
node scripts/workspace.js call drive files.list '{"pageSize":5,"fields":"files(id,name)"}'
node scripts/workspace.js call calendar events.list '{"calendarId":"primary","maxResults":10,"singleEvents":true,"orderBy":"startTime"}'
node scripts/workspace.js call docs documents.get '{"documentId":"<DOC_ID>"}'
Convenience commands
node scripts/workspace.js calendar-today
node scripts/workspace.js drive-search "name contains 'Roadmap' and trashed=false"
node scripts/workspace.js gmail-search "from:alice@example.com newer_than:7d"
Operational guidance for the agent
- Always run
node scripts/auth.js statusfirst. - If auth is missing/expired, run
node scripts/auth.js loginimmediately and wait for user to complete browser consent. - Do not just explain setup unless a command actually failed and its error output requires user action.
- Use
workspace.js callfor precise operations and return raw JSON results. - For user-friendly output, post-process JSON after the call.
- Never print token contents back to the user.