diff --git a/_skill-index.md b/_skill-index.md index c0e5785..79e0cc7 100644 --- a/_skill-index.md +++ b/_skill-index.md @@ -44,6 +44,7 @@ description: Master index of all skills in your robot assistant system. Your ass | "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** | | "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** | --- @@ -235,6 +236,12 @@ description: Master index of all skills in your robot assistant system. Your ass **File:** `skills/silverbullet-query/SKILL.md` **Dependencies:** SilverBullet running with Space Lua enabled +### Clipboard History +**Purpose:** Retrieve items from clipboard history using Maccy on macOS. Query the Maccy SQLite database to find recently copied text, URLs, or search for specific content. macOS only. +**Triggers:** "clipboard history," "from maccy," "what was on my clipboard," "get the last link I copied" +**File:** `skills/clipboard-history/SKILL.md` +**Dependencies:** Maccy (`brew install --cask maccy`), macOS + --- ## Adding New Skills diff --git a/clipboard-history/SKILL.md b/clipboard-history/SKILL.md new file mode 100644 index 0000000..b094682 --- /dev/null +++ b/clipboard-history/SKILL.md @@ -0,0 +1,49 @@ +--- +name: clipboard-history +description: | + Retrieve items from clipboard history using Maccy on macOS. + + Triggers when user mentions: + - "clipboard history" + - "from maccy" + - "what was on my clipboard" + - "get the last link I copied" +--- + +## Quick Usage (Already Configured) + +### Query clipboard history + +Maccy stores history in a Core Data SQLite database inside its app sandbox. Query it directly: + +```bash +# All recent clipboard items containing a URL +sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \ + "SELECT h.ZTITLE, c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime') FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' AND c.ZVALUE LIKE '%http%' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT 10;" +``` + +```bash +# Last N clipboard items (any content type) +sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \ + "SELECT c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime'), h.ZAPPLICATION FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT N;" +``` + +```bash +# Search clipboard history for specific text +sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \ + "SELECT c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime') FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' AND c.ZVALUE LIKE '%search_term%' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT 10;" +``` + +## Important Notes + +- This skill is macOS only. If the platform is not macOS, do not attempt to use it. +- The database is Core Data format with Z-prefixed tables: `ZHISTORYITEM` and `ZHISTORYITEMCONTENT`. +- Content types are stored in `ZTYPE`. The most common is `public.utf8-plain-text`. Other types include `public.png`, `public.file-url`, etc. +- The `ZVALUE` column is a BLOB but can be read as text for plain text entries. +- Timestamps are stored as Unix epoch in `ZLASTCOPIEDAT`. +- Maccy must be installed and running for this to work. Install via: `brew install --cask maccy` + +## Database Schema Reference + +- `ZHISTORYITEM`: main table with metadata (title, timestamps, source application) +- `ZHISTORYITEMCONTENT`: actual clipboard content, linked via `ZITEM = Z_PK`