googleworkspace avatar

Recipe Watch Drive Changes

Sets up Google Drive change notifications using Google Workspace Events API to monitor file and folder updates in real time. You'll use this when building apps that need to react immediately to Drive changes instead of polling constantly. Creates event subscriptions with Pub/Sub endpoints, lists active subscriptions, and handles renewal before expiry. The honest take: it's essential plumbing for any serious Drive integration, but you'll need to handle the Pub/Sub message processing separately. Saves you from writing boilerplate subscription management code and gives you the three core operations you actually need.

skills.sh installs
31K
GitHub stars
32.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add googleworkspace/cli --skill recipe-watch-drive-changes --agent claude-code

Installs into .claude/skills of the current project.

Files

Watch for Drive Changes

PREREQUISITE: Load the following skills to execute this recipe: gws-events

Subscribe to change notifications on a Google Drive file or folder.

Steps

  1. Create subscription: gws events subscriptions create --json '{"targetResource": "//drive.googleapis.com/drives/DRIVE_ID", "eventTypes": ["google.workspace.drive.file.v1.updated"], "notificationEndpoint": {"pubsubTopic": "projects/PROJECT/topics/TOPIC"}, "payloadOptions": {"includeResource": true}}'
  2. List active subscriptions: gws events subscriptions list
  3. Renew before expiry: gws events +renew --subscription SUBSCRIPTION_ID

Sponsors

Details

Repository
github.com/googleworkspace/cli
Category
CLI & Terminal

More from googleworkspace/cli

All 113
1googleworkspace avatarrecipe-create-shared-drivegoogleworkspace/cliCreate a Google Shared Drive and add members with appropriate roles.31Kskills.sh installs
2googleworkspace avatarrecipe-share-doc-and-notifygoogleworkspace/cliShare a Google Docs document with edit access and email collaborators the link.30.9Kskills.sh installs
3googleworkspace avatarrecipe-find-large-filesgoogleworkspace/cliIdentify large Google Drive files consuming storage quota.30.9Kskills.sh installs
4googleworkspace avatarrecipe-review-overdue-tasksgoogleworkspace/cliFind Google Tasks that are past due and need attention.30.8Kskills.sh installs
5googleworkspace avatarrecipe-copy-sheet-for-new-monthgoogleworkspace/cliDuplicate a Google Sheets template tab for a new month of tracking.30.8Kskills.sh installs
6googleworkspace avatarrecipe-batch-invite-to-eventgoogleworkspace/cliAdd a list of attendees to an existing Google Calendar event and send notifications.30.8Kskills.sh installs