google-workspace-with-own-keys
Google Calendar and Gmail integration using your own GCP project credentials (BYoK — Bring Your Own Key). Direct OAuth2 auth against your own Google Cloud…
от rondoflow★ 37 звёзд на GitHub
Установить google-workspace-with-own-keys в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Google Workspace BYoK (Bring Your Own Key)
Direct Google Calendar and Gmail API access using your own GCP project OAuth2 credentials. Supports multiple Google accounts.
Prerequisites
- Node.js (v18+)
- A Google Cloud project with Calendar and Gmail APIs enabled
- OAuth2 Desktop app credentials from your GCP project
Setup
Step 1: Install Dependencies
cd {baseDir}/scripts && npm install
This installs googleapis (Google API client) and mupdf (PDF text extraction for email attachments).
Step 2: Create a Google Cloud Project
- Go to Google Cloud Console and create a new project (or use an existing one)
- Enable the Google Calendar API and Gmail API:
- Go to APIs & Services → Library
- Search for "Google Calendar API" → click Enable
- Search for "Gmail API" → click Enable
Step 3: Configure the OAuth Consent Screen
- Go to Google Auth Platform → Audience (direct link)
- If prompted, configure the consent screen:
- App name: anything (e.g., "OpenClaw")
- User support email: your email
- Scopes: skip (the auth script requests scopes at runtime)
- If your app is in Testing publishing status (the default), add every Google account you want to authorize as a test user:
- Under Test users, click Add users
- Enter the email addresses of each account you'll connect
- Save
⚠️ Important: Apps in "Testing" status have a 7-day token expiry. To get long-lived tokens, publish your app to "Production" in the Audience settings. For personal Gmail accounts (External user type), you can skip Google's verification review — you'll just see an "unverified app" warning during consent. This is fine for personal use.
Step 4: Create OAuth Credentials
- Go to Google Auth Platform → Clients (direct link)
- Click Create Client → choose Desktop app as the application type
- Name it whatever you like (e.g., "OpenClaw")
- Click Create and download the credentials JSON
- Run the setup script:
node {baseDir}/scripts/setup.js --credentials /path/to/downloaded-credentials.json
This copies your credentials to ~/.openclaw/google-workspace-byok/credentials.json.
Step 5: Authorize Google Accounts
For each Google account you want to connect:
node {baseDir}/scripts/auth.js --account <label>
The <label> is a friendly name you'll use to reference this account (e.g., "personal", "work", "household").
Auth flow:
- The script prints an authorization URL
- Open the URL in your browser and sign in with the Google account
- Grant the requested permissions
- You'll be redirected to
http://localhost/...— the page won't load, and that's expected - Copy the full URL from your browser's address bar and paste it back into the script
- The script exchanges the code for tokens and saves them
Scopes requested (default — read/write):
calendar— Full read/write access to Google Calendargmail.readonly— Read-only access to Gmail
Pass --readonly to request read-only calendar access instead.
Tokens are stored in ~/.openclaw/google-workspace-byok/tokens/<label>.json.
Usage
All scripts are in {baseDir}/scripts/. Run them with node.
Calendar
# List all calendars
node {baseDir}/scripts/calendar.js --account <label> --action list-calendars
# List upcoming events (default: next 7 days, primary calendar)
node {baseDir}/scripts/calendar.js --account <label> --action events
# List events with options
node {baseDir}/scripts/calendar.js --account <label> --action events --calendar <calendarId> --days <number> --max <number>
# Get a specific event
node {baseDir}/scripts/calendar.js --account <label> --action get-event --calendar <calendarId> --event-id <eventId>
# Check free/busy
node {baseDir}/scripts/calendar.js --account <label> --action freebusy --days <number>
Gmail
# List recent emails (default: 10)
node {baseDir}/scripts/gmail.js --account <label> --action list
# Search emails
node {baseDir}/scripts/gmail.js --account <label> --action list --query "from:[email protected]" --max 20
# Read a specific email (includes attachment metadata with IDs)
node {baseDir}/scripts/gmail.js --account <label> --action read --message-id <messageId>
# Download all attachments from an email
node {baseDir}/scripts/gmail.js --account <label> --action attachment --message-id <messageId> --out-dir /tmp/attachments
# Download a specific attachment
node {baseDir}/scripts/gmail.js --account <label> --action attachment --message-id <messageId> --attachment-id <id> --out-dir /tmp
# List labels
node {baseDir}/scripts/gmail.js --account <label> --action labels
Gmail search uses the same query syntax as the Gmail web search box (e.g., is:unread, from:, `newer_
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- manifest.json
FAQ
Что делает скилл google-workspace-with-own-keys?
Google Calendar and Gmail integration using your own GCP project credentials (BYoK — Bring Your Own Key). Direct OAuth2 auth against your own Google Cloud project. Read calendars, events, and emails across multiple Google accounts. Use this skill when users want to check their c…
Как установить скилл google-workspace-with-own-keys?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл google-workspace-with-own-keys запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…