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
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.playwright-auth/
|
||||
|
|
@ -44,6 +44,7 @@ description: Master index of all skills in your robot assistant system. Your ass
|
|||
| "add a contact," "look up a contact," "find someone's number," "update a contact," "delete a contact," "list my contacts," "contacts" | **contacts** |
|
||||
| "transcribe this video," "get the subtitles," "what does this video say," "summarize this YouTube video," "YouTube transcript" | **youtube-transcript** |
|
||||
| "upload to s2," "s2," "s2 storage," "upload a file," "store this file" | **s2-storage** |
|
||||
| "read this email," "review this email," "open this gmail," "check my gmail" | **gmail-browser** |
|
||||
| "make a query," "show all pages tagged," "build a filter," "list tasks in," "show recent notes," "create a silverbullet view," "make a live widget" | **silverbullet-query** |
|
||||
| "clipboard history," "from maccy," "what was on my clipboard," "get the last link I copied" | **clipboard-history** |
|
||||
|
||||
|
|
@ -231,6 +232,12 @@ description: Master index of all skills in your robot assistant system. Your ass
|
|||
**File:** `skills/youtube-transcript/SKILL.md`
|
||||
**Dependencies:** `yt-dlp` CLI, Python 3
|
||||
|
||||
### Gmail Browser
|
||||
**Purpose:** Read Gmail emails using a persistent authenticated Chromium session. Loads saved auth state from `skills/.playwright-auth/google.json` — no manual login needed unless the session has expired.
|
||||
**Triggers:** "read this email," "review this email," "open this gmail," "check my gmail"
|
||||
**File:** `skills/gmail-browser/SKILL.md`
|
||||
**Dependencies:** `playwright-cli`, saved auth state at `skills/.playwright-auth/google.json`
|
||||
|
||||
### S2 Storage
|
||||
**Purpose:** Upload and manage files on S2, a self-hosted file storage service at s2.connorrhodes.com. Use `skills/s2-storage/scripts/s2_upload.py` for all uploads — do not rewrite the curl command inline in other skills.
|
||||
**Triggers:** "upload to s2," "s2," "s2 storage," "upload a file," "store this file"
|
||||
|
|
|
|||
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