{"id":"4b50f05b-8fd2-420f-a97c-8db14913dd3c","shortId":"hkZnJe","kind":"skill","title":"gws-gmail-watch","tagline":"Gmail: Watch for new emails and stream them as NDJSON.","description":"# gmail +watch\n\n> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.\n\nWatch for new emails and stream them as NDJSON\n\n## Usage\n\n```bash\ngws gmail +watch\n```\n\n## Flags\n\n| Flag | Required | Default | Description |\n|------|----------|---------|-------------|\n| `--project` | — | — | GCP project ID for Pub/Sub resources |\n| `--subscription` | — | — | Existing Pub/Sub subscription name (skip setup) |\n| `--topic` | — | — | Existing Pub/Sub topic with Gmail push permission already granted |\n| `--label-ids` | — | — | Comma-separated Gmail label IDs to filter (e.g., INBOX,UNREAD) |\n| `--max-messages` | — | 10 | Max messages per pull batch |\n| `--poll-interval` | — | 5 | Seconds between pulls |\n| `--msg-format` | — | full | Gmail message format: full, metadata, minimal, raw |\n| `--once` | — | — | Pull once and exit |\n| `--cleanup` | — | — | Delete created Pub/Sub resources on exit |\n| `--output-dir` | — | — | Write each message to a separate JSON file in this directory |\n\n## Examples\n\n```bash\ngws gmail +watch --project my-gcp-project\ngws gmail +watch --project my-project --label-ids INBOX --once\ngws gmail +watch --subscription projects/p/subscriptions/my-sub\ngws gmail +watch --project my-project --cleanup --output-dir ./emails\n```\n\n## Tips\n\n- Gmail watch expires after 7 days — re-run to renew.\n- Without --cleanup, Pub/Sub resources persist for reconnection.\n- Press Ctrl-C to stop gracefully.\n\n## See Also\n\n- [gws-shared](../gws-shared/SKILL.md) — Global flags and auth\n- [gws-gmail](../gws-gmail/SKILL.md) — All send, read, and manage email commands","tags":["gws","gmail","watch","cli","googleworkspace","agent-skills","ai-agent","automation","discovery-api","gemini-cli-extension","google-admin","google-api"],"capabilities":["skill","source-googleworkspace","skill-gws-gmail-watch","topic-agent-skills","topic-ai-agent","topic-automation","topic-cli","topic-discovery-api","topic-gemini-cli-extension","topic-google-admin","topic-google-api","topic-google-calendar","topic-google-chat","topic-google-docs","topic-google-drive"],"categories":["cli"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/googleworkspace/cli/gws-gmail-watch","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add googleworkspace/cli","source_repo":"https://github.com/googleworkspace/cli","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 26371 github stars · SKILL.md body (1,654 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:30.379Z","embedding":null,"createdAt":"2026-04-18T20:24:37.966Z","updatedAt":"2026-05-18T18:52:30.379Z","lastSeenAt":"2026-05-18T18:52:30.379Z","tsv":"'/emails':185 '/gws-gmail/skill.md':225 '/gws-shared/skill.md':19,217 '10':97 '5':106 '7':191 'alreadi':78 'also':213 'auth':21,221 'bash':47,148 'batch':102 'c':208 'cleanup':126,181,199 'comma':84 'comma-separ':83 'command':232 'creat':35,128 'ctrl':207 'ctrl-c':206 'day':192 'default':54 'delet':127 'descript':55 'dir':135,184 'directori':146 'e.g':91 'email':9,40,231 'exampl':147 'exist':64,71 'exit':125,132 'expir':189 'file':143 'filter':90 'flag':23,51,52,219 'format':112,116 'full':113,117 'gcp':57,155 'generat':32 'generate-skil':31 'global':22,218 'gmail':3,5,15,49,75,86,114,150,158,170,175,187,224 'grace':211 'grant':79 'gws':2,30,48,149,157,169,174,215,223 'gws-gmail':222 'gws-gmail-watch':1 'gws-share':214 'id':59,82,88,166 'inbox':92,167 'interv':105 'json':142 'label':81,87,165 'label-id':80,164 'manag':230 'max':95,98 'max-messag':94 'messag':96,99,115,138 'metadata':118 'minim':119 'miss':28 'msg':111 'msg-format':110 'my-gcp-project':153 'my-project':161,178 'name':67 'ndjson':14,45 'new':8,39 'output':134,183 'output-dir':133,182 'per':100 'permiss':77 'persist':202 'poll':104 'poll-interv':103 'prerequisit':17 'press':205 'project':56,58,152,156,160,163,177,180 'projects/p/subscriptions/my-sub':173 'pub/sub':61,65,72,129,200 'pull':101,109,122 'push':76 'raw':120 're':194 're-run':193 'read':18,228 'reconnect':204 'renew':197 'requir':53 'resourc':62,130,201 'rule':26 'run':29,195 'second':107 'secur':25 'see':212 'send':227 'separ':85,141 'setup':69 'share':216 'skill':33 'skill-gws-gmail-watch' 'skip':68 'source-googleworkspace' 'stop':210 'stream':11,42 'subscript':63,66,172 'tip':186 'topic':70,73 'topic-agent-skills' 'topic-ai-agent' 'topic-automation' 'topic-cli' 'topic-discovery-api' 'topic-gemini-cli-extension' 'topic-google-admin' 'topic-google-api' 'topic-google-calendar' 'topic-google-chat' 'topic-google-docs' 'topic-google-drive' 'unread':93 'usag':46 'watch':4,6,16,37,50,151,159,171,176,188 'without':198 'write':136","prices":[{"id":"4f6d66fb-608a-43fc-bb70-e857de257e46","listingId":"4b50f05b-8fd2-420f-a97c-8db14913dd3c","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"googleworkspace","category":"cli","install_from":"skills.sh"},"createdAt":"2026-04-18T20:24:37.966Z"}],"sources":[{"listingId":"4b50f05b-8fd2-420f-a97c-8db14913dd3c","source":"github","sourceId":"googleworkspace/cli/gws-gmail-watch","sourceUrl":"https://github.com/googleworkspace/cli/tree/main/skills/gws-gmail-watch","isPrimary":false,"firstSeenAt":"2026-04-18T21:51:58.077Z","lastSeenAt":"2026-05-18T18:52:30.379Z"},{"listingId":"4b50f05b-8fd2-420f-a97c-8db14913dd3c","source":"skills_sh","sourceId":"googleworkspace/cli/gws-gmail-watch","sourceUrl":"https://skills.sh/googleworkspace/cli/gws-gmail-watch","isPrimary":true,"firstSeenAt":"2026-04-18T20:24:37.966Z","lastSeenAt":"2026-05-07T22:40:14.928Z"}],"details":{"listingId":"4b50f05b-8fd2-420f-a97c-8db14913dd3c","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"googleworkspace","slug":"gws-gmail-watch","github":{"repo":"googleworkspace/cli","stars":26371,"topics":["agent-skills","ai-agent","automation","cli","discovery-api","gemini-cli-extension","google-admin","google-api","google-calendar","google-chat","google-docs","google-drive","google-sheets","google-workspace","oauth2","rust"],"license":"apache-2.0","html_url":"https://github.com/googleworkspace/cli","pushed_at":"2026-05-12T16:46:11Z","description":"Google Workspace CLI — one command-line tool for Drive, Gmail, Calendar, Sheets, Docs, Chat, Admin, and more. Dynamically built from Google Discovery Service. Includes AI agent skills.","skill_md_sha":"fca780f7e80a0ce814040861e2c40aeb3d4dd0da","skill_md_path":"skills/gws-gmail-watch/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/googleworkspace/cli/tree/main/skills/gws-gmail-watch"},"layout":"multi","source":"github","category":"cli","frontmatter":{"name":"gws-gmail-watch","description":"Gmail: Watch for new emails and stream them as NDJSON."},"skills_sh_url":"https://skills.sh/googleworkspace/cli/gws-gmail-watch"},"updatedAt":"2026-05-18T18:52:30.379Z"}}