recipe-watch-drive-changes

Subscribe to change notifications on Google Drive files and folders.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-watch-drive-changes-oresttokovenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recipe-watch-drive-changes
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/recipe-watch-drive-changes
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill recipe-watch-drive-changes-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams need to react when files in Google Drive change, but manually polling for updates is inefficient. This Skill sets up event subscriptions so you receive notifications whenever a Drive file or folder is updated. ## Core Features & Use Cases - Create Subscriptions: Register a watch on a Drive file or folder using the Google Workspace Events API via the gws CLI. - Manage Subscriptions: List active subscriptions and renew them before they expire. - Use Case: You want your pipeline to react whenever a shared Drive folder receives new files. Create a subscription targeting that folder with a Pub/Sub topic, then renew it before expiry to keep notifications flowing. ## Quick Start Ask the AI to create a Google Drive change subscription for your Drive ID pointing to your Pub/Sub topic using the gws events command.

Frequently Asked Questions about recipe-watch-drive-changes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I watch a Google Drive folder for changes?

Create a subscription with the gws events subscriptions create command, targeting the Drive resource and specifying event types like google.workspace.drive.file.v1.updated. Notifications are delivered to a Google Cloud Pub/Sub topic you configure.

How do I list active Google Workspace event subscriptions?

Run gws events subscriptions list to see all active subscriptions. This shows the subscriptions you have created so you can track their targets and expiry times.

How do I renew a Drive change subscription before it expires?

Use gws events +renew --subscription SUBSCRIPTION_ID to extend the subscription lifetime. Renew before the expiry time to avoid gaps in change notifications.

What do I need before creating a Drive change subscription?

You need the gws CLI installed, the gws-events skill loaded, a Drive ID to watch, and a Google Cloud Pub/Sub topic to receive notifications. The subscription payload can optionally include the changed resource itself.

Can Drive change notifications include the updated file content?

Yes, set includeResource to true in the payloadOptions when creating the subscription. This includes the resource data in the notification payload delivered to your Pub/Sub topic.