π¦ ClawHub
Google Suite Skill
by @cenralsolution
Provides unified access to Gmail, Google Calendar, and Drive APIs for managing emails, calendar events, and files with OAuth2 authentication.
TERMINAL
clawhub install google-suiteπ About This Skill
Google Suite Skill
Version: 1.0.0 Category: Productivity Description: Unified access to Gmail, Google Calendar, and Google Drive APIs for sending, reading, deleting emails, managing calendar events, and handling files.
Features
Gmail
Google Calendar
Google Drive
Setup
Prerequisites
Environment Variables
GOOGLE_OAUTH_CLIENT_ID - OAuth2 client IDGOOGLE_OAUTH_CLIENT_SECRET - OAuth2 client secretGOOGLE_OAUTH_REDIRECT_URI - OAuth2 redirect URI (e.g., http://localhost:8080/callback)Required Scopes
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/driveToken Storage
google_suite_tokens.json (by default)Installation
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
Usage
Authentication
1. On first use, the skill will prompt for OAuth2 authentication. 2. Visit the provided URL, log in, and paste the authorization code. 3. Tokens will be saved for future use.Example Calls
#### Send Email
skill.execute({
"service": "gmail",
"action": "send",
"to": "user@example.com",
"subject": "Test Email",
"body": "Hello from OpenClaw!"
})
#### List Emails
skill.execute({
"service": "gmail",
"action": "list",
"query": "from:boss@company.com"
})
#### Delete Email
skill.execute({
"service": "gmail",
"action": "delete",
"message_id": "XYZ123..."
})
#### List Calendar Events
skill.execute({
"service": "calendar",
"action": "list",
"days": 7
})
#### Create Calendar Event
skill.execute({
"service": "calendar",
"action": "create",
"summary": "Team Meeting",
"start": "2024-03-01T10:00:00",
"end": "2024-03-01T11:00:00"
})
#### List Drive Files
skill.execute({
"service": "drive",
"action": "list",
"query": "name contains 'report'"
})
#### Upload File to Drive
skill.execute({
"service": "drive",
"action": "upload",
"file_path": "./myfile.pdf"
})
Security
Troubleshooting
google_suite_tokens.json to force re-authentication if needed.References
π‘ Examples
Authentication
1. On first use, the skill will prompt for OAuth2 authentication. 2. Visit the provided URL, log in, and paste the authorization code. 3. Tokens will be saved for future use.Example Calls
#### Send Email
skill.execute({
"service": "gmail",
"action": "send",
"to": "user@example.com",
"subject": "Test Email",
"body": "Hello from OpenClaw!"
})
#### List Emails
skill.execute({
"service": "gmail",
"action": "list",
"query": "from:boss@company.com"
})
#### Delete Email
skill.execute({
"service": "gmail",
"action": "delete",
"message_id": "XYZ123..."
})
#### List Calendar Events
skill.execute({
"service": "calendar",
"action": "list",
"days": 7
})
#### Create Calendar Event
skill.execute({
"service": "calendar",
"action": "create",
"summary": "Team Meeting",
"start": "2024-03-01T10:00:00",
"end": "2024-03-01T11:00:00"
})
#### List Drive Files
skill.execute({
"service": "drive",
"action": "list",
"query": "name contains 'report'"
})
#### Upload File to Drive
skill.execute({
"service": "drive",
"action": "upload",
"file_path": "./myfile.pdf"
})
βοΈ Configuration
Prerequisites
Environment Variables
GOOGLE_OAUTH_CLIENT_ID - OAuth2 client IDGOOGLE_OAUTH_CLIENT_SECRET - OAuth2 client secretGOOGLE_OAUTH_REDIRECT_URI - OAuth2 redirect URI (e.g., http://localhost:8080/callback)Required Scopes
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/driveToken Storage
google_suite_tokens.json (by default)Installation
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
π Tips & Best Practices
google_suite_tokens.json to force re-authentication if needed.