@tensorfold

OpenClaw Google Workspace

All-in-one Google Workspace plugin for OpenClaw with shared OAuth. Supports Gmail, Calendar, Drive, Contacts, Tasks, and Sheets as toggleable services.

Current version
v0.2.1
code-pluginCommunitysource-linked

@tensorfold/openclaw-google-workspace

All-in-one Google Workspace plugin for OpenClaw. One plugin, one OAuth flow, six Google services.

Gmail | Calendar | Drive | Contacts | Tasks | Sheets

Why This Plugin

Setting up Google integrations in OpenClaw typically requires installing 3+ separate plugins, each with its own OAuth flow, token management, and configuration. This creates friction during client deployments:

  • Multiple openclaw plugins install commands
  • Separate OAuth authorization for each service
  • Different config schemas that conflict
  • No shared token management

This plugin solves that. One install, one OAuth flow, one config block. Services are toggled on/off with a boolean.

Quick Start

1. Install

openclaw plugins install @tensorfold/openclaw-google-workspace

2. Set up Google Cloud (one-time)

Create a Google Cloud project with the APIs you need enabled, then download OAuth Desktop Client credentials. See docs/google-cloud-setup.md for the full walkthrough.

3. Place credentials

mkdir -p ~/.openclaw/secrets
cp client_secret_*.json ~/.openclaw/secrets/google-oauth.json
chmod 600 ~/.openclaw/secrets/google-oauth.json

4. Configure openclaw.json

{
  "plugins": {
    "allow": ["openclaw-google-workspace"],
    "entries": {
      "openclaw-google-workspace": {
        "enabled": true,
        "config": {
          "credentialsPath": "./secrets/google-oauth.json",
          "tokenPath": "./secrets/google-tokens.json",
          "services": {
            "gmail": { "enabled": true },
            "calendar": { "enabled": true },
            "drive": { "enabled": true, "readOnly": true }
          }
        }
      }
    }
  },
  "tools": {
    "allow": ["openclaw-google-workspace"]
  }
}

5. Restart, authorize, use

openclaw gateway restart

Then via your chat channel:

"Run google_workspace_begin_auth" (click URL, sign in, grant consent, copy code) "Run google_workspace_complete_auth with code 4/0AXY..." "What's in my inbox?"

Configuration Reference

Top-level Config

PropertyTypeRequiredDescription
credentialsPathstringYesPath to Google OAuth client credentials JSON
tokenPathstringYesPath where OAuth tokens are stored
oauthRedirectUristringNoOverride redirect URI (defaults to credentials file value)
servicesobjectNoPer-service configuration (see below)

Service Configuration

ServiceDefault EnabledDefault ReadOnlyProperties
gmailtruefalseenabled, readOnly, maxSearchResults
calendartruefalseenabled, readOnly, defaultCalendarId, defaultTimeZone, upcomingWindowDays
drivetruetrueenabled, readOnly, maxSearchResults
contactsfalseenabled, maxSearchResults
tasksfalseenabled
sheetsfalsetrueenabled, readOnly

Environment Variable Overrides

All config properties can be overridden via environment variables:

VariableOverrides
GOOGLE_WORKSPACE_CREDENTIALS_PATHcredentialsPath
GOOGLE_WORKSPACE_TOKEN_PATHtokenPath
GOOGLE_WORKSPACE_OAUTH_REDIRECT_URIoauthRedirectUri
GOOGLE_WORKSPACE_GMAIL_ENABLEDservices.gmail.enabled
GOOGLE_WORKSPACE_CALENDAR_ENABLEDservices.calendar.enabled
GOOGLE_WORKSPACE_DRIVE_ENABLEDservices.drive.enabled
GOOGLE_WORKSPACE_CONTACTS_ENABLEDservices.contacts.enabled
GOOGLE_WORKSPACE_TASKS_ENABLEDservices.tasks.enabled
GOOGLE_WORKSPACE_SHEETS_ENABLEDservices.sheets.enabled

Available Tools

Authentication (3 tools — always available)

ToolDescription
google_workspace_begin_authGenerate OAuth URL for all enabled services
google_workspace_complete_authExchange authorization code for tokens
google_workspace_auth_statusCheck auth state, enabled services, scope gaps

Gmail (5 tools)

ToolDescription
google_gmail_searchSearch messages using Gmail search syntax
google_gmail_readRead a specific email by ID
google_gmail_list_unreadList unread inbox messages
google_gmail_list_by_labelList messages by label
google_gmail_sendSend an email (blocked in read-only mode)

Calendar (5 tools)

ToolDescription
google_calendar_list_eventsList upcoming events
google_calendar_create_eventCreate event (requires confirmation)
google_calendar_update_eventUpdate event (requires confirmation)
google_calendar_delete_eventDelete event (requires confirmation)
google_calendar_find_next_meetingFind next meeting today

Drive (4 tools)

ToolDescription
google_drive_list_filesList files in a folder
google_drive_read_fileRead file content or metadata
google_drive_searchFull-text search across Drive
google_drive_create_fileCreate a file (blocked in read-only mode)

Contacts (2 tools)

ToolDescription
google_contacts_searchSearch contacts by name/email
google_contacts_getGet a specific contact

Tasks (3 tools)

ToolDescription
google_tasks_listList tasks
google_tasks_createCreate a task
google_tasks_completeMark task as completed

Sheets (2 tools)

ToolDescription
google_sheets_readRead data from a spreadsheet
google_sheets_writeWrite data (blocked in read-only mode)

Authentication

All services share a single Google OAuth2 flow. Scopes are computed dynamically based on which services are enabled:

ServiceRead-Only ScopeRead-Write Scope
Gmailgmail.readonlygmail.modify + gmail.send
Calendarcalendar.events.readonlycalendar.events
Drivedrive.readonlydrive.file
Contactscontacts.readonlycontacts.readonly
Taskstasks.readonlytasks
Sheetsspreadsheets.readonlyspreadsheets

Token management:

  • Tokens stored securely with chmod 600 permissions
  • Auto-refresh when access token expires
  • Incremental scope addition when enabling new services (include_granted_scopes: true)

Adding services later: Enable the service in config, restart gateway, run begin_auth again. The OAuth URL requests the new scopes while preserving existing grants.

Coexistence with Other Plugins

This plugin uses tool-based Gmail integration (search, read, send on demand). It does not replace the @mcinteerj/openclaw-gmail channel plugin which provides inbound email polling and auto-replies. Both can be installed simultaneously — they use different tool names and serve different purposes.

Similarly, this plugin's calendar tools use the google_calendar_* prefix and will not conflict with the standalone openclaw-google-calendar plugin if both are installed.

Migration from Existing Plugins

If you're currently using separate Gmail and Calendar plugins:

  1. Install this plugin alongside existing ones
  2. Verify it works with your Google account
  3. Disable the old plugins in openclaw.json ("enabled": false)
  4. Remove old plugins from plugins.allow and tools.allow
  5. Restart gateway

Documentation

Development

# Clone and install
git clone https://github.com/tensorfold/openclaw-google-workspace.git
cd openclaw-google-workspace
npm install

# Type check
npm run typecheck

# Local install for testing
openclaw plugins install .

License

MIT - TensorFold

Source and release

Source repository

tensorfold/openclaw-google-workspace

Open repo

Source commit

498a680857acb0feee7442624cfc4c3aee351c7e

View commit

Install command

openclaw plugins install clawhub:@tensorfold/openclaw-google-workspace

Metadata

  • Package: @tensorfold/openclaw-google-workspace
  • Created: 2026/04/02
  • Updated: 2026/05/21
  • Executes code: Yes
  • Source tag: main

Compatibility

  • Built with OpenClaw: 2026.1.0
  • Plugin API range: >=2026.1.0
  • Tags: latest
  • Files: 35