Add gmail-browser skill with persistent auth session
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5dcfd0413d
commit
e86b720497
3 changed files with 54 additions and 0 deletions
46
gmail-browser/SKILL.md
Normal file
46
gmail-browser/SKILL.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
name: gmail-browser
|
||||
description: Read Gmail emails and threads using a persistent authenticated Chromium session. Use when asked to read, review, or extract content from a Gmail URL.
|
||||
version: 1.0.0
|
||||
---
|
||||
|
||||
# Gmail Browser
|
||||
|
||||
Read Gmail emails via Playwright using a saved auth session (no manual login required).
|
||||
|
||||
## Auth State
|
||||
|
||||
Saved at: `~/notes/skills/.playwright-auth/google.json`
|
||||
|
||||
If the session has expired (redirects to Google sign-in), run the re-auth flow below.
|
||||
|
||||
## Reading an Email
|
||||
|
||||
```bash
|
||||
# Start a named session with saved auth
|
||||
playwright-cli -s=gmail open --persistent 2>&1 &
|
||||
sleep 5
|
||||
playwright-cli -s=gmail state-load ~/notes/skills/.playwright-auth/google.json
|
||||
playwright-cli -s=gmail goto "<gmail_url>"
|
||||
|
||||
# Extract full email body text
|
||||
playwright-cli -s=gmail eval "Array.from(document.querySelectorAll('.a3s')).map(el => el.innerText).join('\n\n---\n\n')"
|
||||
|
||||
# Close when done
|
||||
playwright-cli -s=gmail close
|
||||
```
|
||||
|
||||
## Re-Auth Flow (if session expired)
|
||||
|
||||
```bash
|
||||
playwright-cli -s=gmail open --persistent --headed "https://accounts.google.com"
|
||||
# User logs in manually in the browser window
|
||||
playwright-cli -s=gmail state-save ~/notes/skills/.playwright-auth/google.json
|
||||
playwright-cli -s=gmail close
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- The `.a3s` CSS class is Gmail's email body container.
|
||||
- The session is saved with `--persistent` so cookies survive restarts as long as state-load is called.
|
||||
- Auth state path is gitignored — do not commit it.
|
||||
Loading…
Add table
Add a link
Reference in a new issue