unhoard-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unhoard_cli-0.1.0/.gitignore +12 -0
- unhoard_cli-0.1.0/AGENTS.md +9 -0
- unhoard_cli-0.1.0/LICENSE +21 -0
- unhoard_cli-0.1.0/Makefile +40 -0
- unhoard_cli-0.1.0/PKG-INFO +286 -0
- unhoard_cli-0.1.0/README.md +252 -0
- unhoard_cli-0.1.0/config.example.toml +25 -0
- unhoard_cli-0.1.0/deploy/unhoard-digest.service +10 -0
- unhoard_cli-0.1.0/deploy/unhoard-digest.timer +10 -0
- unhoard_cli-0.1.0/deploy/unhoard-web.service +15 -0
- unhoard_cli-0.1.0/docs/ACTIVE.md +16 -0
- unhoard_cli-0.1.0/notion.env.example +8 -0
- unhoard_cli-0.1.0/pyproject.toml +61 -0
- unhoard_cli-0.1.0/src/unhoard/__init__.py +3 -0
- unhoard_cli-0.1.0/src/unhoard/cli.py +367 -0
- unhoard_cli-0.1.0/src/unhoard/config.py +120 -0
- unhoard_cli-0.1.0/src/unhoard/curation.py +562 -0
- unhoard_cli-0.1.0/src/unhoard/db.py +852 -0
- unhoard_cli-0.1.0/src/unhoard/enrich.py +305 -0
- unhoard_cli-0.1.0/src/unhoard/mcp_server.py +234 -0
- unhoard_cli-0.1.0/src/unhoard/notion_sync.py +339 -0
- unhoard_cli-0.1.0/src/unhoard/static/index.html +1336 -0
- unhoard_cli-0.1.0/src/unhoard/unfurl.py +148 -0
- unhoard_cli-0.1.0/src/unhoard/video_summary.py +613 -0
- unhoard_cli-0.1.0/src/unhoard/web.py +208 -0
- unhoard_cli-0.1.0/tests/test_core.py +198 -0
- unhoard_cli-0.1.0/uv.lock +1454 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# AGENTS.md — unhoard
|
|
2
|
+
|
|
3
|
+
> Readwise-style bookmark triage dashboard, Fri–Sat–Sun push email digest, and MCP server for Notion bookmark databases (Tweetsmash schema).
|
|
4
|
+
|
|
5
|
+
## Working Rules
|
|
6
|
+
1. **Never commit secrets or personal state:** Keep `~/.config/unhoard/notion.env`, `~/.config/unhoard/config.toml`, OpenMail env files, and `~/.local/state/unhoard/bookmarks.sqlite3` strictly outside Git. Never print API keys in logs or stdout.
|
|
7
|
+
2. **Safe Notion write-back only:** Only write to the existing **`Done Reading?`** (`Done` / `Pending`) and **`Tags`** (multi-select) properties in Notion so upstream bookmark exporters stay unaffected. Local review states (`deep_read`, `snoozed`, `archived`, `user_note`, `tldr`, `signal_score`) live exclusively in SQLite.
|
|
8
|
+
3. **Email safety:** `unhoard digest` defaults to dry-run preview (`status = preview`). Only pass `--send` when explicitly sending, always with a per-date idempotency key (`unhoard-digest-YYYY-MM-DD`).
|
|
9
|
+
4. **Verification:** Run `uv run pytest -q` after changes and validate any inline JS in `src/unhoard/static/index.html` with `node --check`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 deven367
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.PHONY: install test sync unfurl enrich transcribe serve digest-preview digest-send stats mcp
|
|
2
|
+
|
|
3
|
+
install:
|
|
4
|
+
uv sync --extra dev --extra transcribe
|
|
5
|
+
|
|
6
|
+
test:
|
|
7
|
+
uv run pytest -q
|
|
8
|
+
|
|
9
|
+
sync:
|
|
10
|
+
uv run unhoard sync
|
|
11
|
+
|
|
12
|
+
unfurl:
|
|
13
|
+
uv run unhoard unfurl
|
|
14
|
+
|
|
15
|
+
enrich:
|
|
16
|
+
uv run unhoard enrich --provider codex --model gpt-6.2-sol
|
|
17
|
+
|
|
18
|
+
enrich-opus:
|
|
19
|
+
uv run unhoard enrich --provider claude --model claude-opus-5-5
|
|
20
|
+
|
|
21
|
+
push-tags:
|
|
22
|
+
uv run unhoard push-tags
|
|
23
|
+
|
|
24
|
+
transcribe:
|
|
25
|
+
uv run unhoard transcribe
|
|
26
|
+
|
|
27
|
+
serve:
|
|
28
|
+
uv run unhoard serve --host 127.0.0.1 --port 8765
|
|
29
|
+
|
|
30
|
+
digest-preview:
|
|
31
|
+
uv run unhoard digest
|
|
32
|
+
|
|
33
|
+
digest-send:
|
|
34
|
+
uv run unhoard digest --send
|
|
35
|
+
|
|
36
|
+
stats:
|
|
37
|
+
uv run unhoard stats
|
|
38
|
+
|
|
39
|
+
mcp:
|
|
40
|
+
uv run unhoard mcp
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: unhoard-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unhoard your Notion Twitter/X bookmarks — Readwise-style daily review dashboard, Fri-Sat-Sun push email digest, >30m video summaries, and local MCP server
|
|
5
|
+
Project-URL: Homepage, https://github.com/deven367/unhoard
|
|
6
|
+
Project-URL: Repository, https://github.com/deven367/unhoard
|
|
7
|
+
Project-URL: Issues, https://github.com/deven367/unhoard/issues
|
|
8
|
+
Author: deven367
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: bookmarks,digest,mcp,notion,readwise,tweetsmash,twitter,whisper
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: fastapi>=0.115.0
|
|
26
|
+
Requires-Dist: httpx>=0.27.0
|
|
27
|
+
Requires-Dist: mcp>=1.6.0
|
|
28
|
+
Requires-Dist: uvicorn>=0.32.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
31
|
+
Provides-Extra: transcribe
|
|
32
|
+
Requires-Dist: faster-whisper>=1.1.0; extra == 'transcribe'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# unhoard
|
|
36
|
+
|
|
37
|
+
Turn an overgrown Notion Twitter/X bookmarks database (exported via [Tweetsmash](https://www.tweetsmash.com/) or similar) into something you can actually keep up with:
|
|
38
|
+
|
|
39
|
+
1. **Readwise-style Daily Review Dashboard** — a calm, keyboard-driven local web UI showing a capped **5-card daily deck** (2 Fresh + 2 Vault Gems + 1 Wildcard), full thread & nested quote-tweet reader, Deep Read queue, and instant full-text search across your entire backlog.
|
|
40
|
+
2. **Weekend Push Email Digest (Fri–Sat–Sun)** — a short, Outlook-safe HTML brief curated from your unread vault so you steadily chip away at papers, repos, and threads without opening another app.
|
|
41
|
+
3. **Local MCP Server (`unhoard`)** — exposes your synced, enriched bookmark vault to coding agents (Claude Code, Codex, Antigravity, Cursor, etc.) so you can ask *"what did I bookmark about X?"* on demand.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Screenshots
|
|
46
|
+
|
|
47
|
+
### Daily Review (Light Mode)
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
### Expanded Thread Reader
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
### Explore Vault (Dark Mode & Instant FTS5 Search)
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
### Weekend Push Email Digest Preview
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Why a Local SQLite Cache?
|
|
62
|
+
|
|
63
|
+
Notion's API rate-limits recursive block reads (~3 req/sec) and its built-in search doesn't index nested callout blocks well. `unhoard` syncs your Notion database and nested Tweetsmash callout trees **once** into a local SQLite + FTS5 database (`~/.local/state/unhoard/bookmarks.sqlite3`), then runs incremental syncs for new saves.
|
|
64
|
+
|
|
65
|
+
**Safe Notion write-back:** `unhoard` only ever writes to two existing Notion columns—**`Done Reading?`** (`Done` / `Pending`) and **`Tags`** (multi-select)—so your bookmark exporter never breaks. Local review states (`Deep Read`, `Snooze`, `Archived`), TL;DRs, signal scores, and personal notes live in SQLite.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Prerequisites
|
|
70
|
+
|
|
71
|
+
- **Python 3.11+** and **[`uv`](https://docs.astral.sh/uv/)**
|
|
72
|
+
- A **Notion** database of exported Twitter/X bookmarks (tested with Tweetsmash's default schema)
|
|
73
|
+
- **Optional (for AI TL;DRs & auto-tagging):** either the [Codex CLI](https://github.com/openai/codex) (`codex`) or [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
|
|
74
|
+
- **Optional (for >30 min video transcription & summaries):** `ffmpeg` / `ffprobe` (plus `yt-dlp` for YouTube captions) and `uv sync --extra transcribe` (`faster-whisper`)
|
|
75
|
+
- **Optional (for weekend push email digests):** [OpenMail CLI](https://openmail.sh/) (`openmail`)
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Setup Guide
|
|
80
|
+
|
|
81
|
+
### 1. Create a Notion Internal Integration
|
|
82
|
+
|
|
83
|
+
1. Go to [notion.so/profile/integrations](https://www.notion.so/profile/integrations) and click **New integration**.
|
|
84
|
+
2. Name it anything (e.g. `bookmarks-vault`), choose your workspace, and keep **Read content** and **Update content** enabled.
|
|
85
|
+
3. Copy the **Internal Integration Secret** (starts with `ntn_` or `secret_`).
|
|
86
|
+
4. Open your bookmarks database in Notion → click **`···`** (top right) → **Connections** → add your new integration.
|
|
87
|
+
5. Copy the **32-character database ID** from your database URL:
|
|
88
|
+
```text
|
|
89
|
+
https://www.notion.so/<workspace>/<DATABASE_ID>?v=<view_id>
|
|
90
|
+
^^^^^^^^^^^^ 32 hex chars
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 2. Install
|
|
94
|
+
|
|
95
|
+
**From PyPI (recommended):**
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# With uv (recommended)
|
|
99
|
+
uv tool install unhoard-cli
|
|
100
|
+
# Or with local Whisper transcription for >30m videos:
|
|
101
|
+
uv tool install "unhoard-cli[transcribe]"
|
|
102
|
+
|
|
103
|
+
# Or with pip
|
|
104
|
+
pip install unhoard-cli
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Or from source:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git clone https://github.com/deven367/unhoard.git
|
|
111
|
+
cd unhoard
|
|
112
|
+
uv sync --extra dev --extra transcribe
|
|
113
|
+
uv run pytest -q
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Initialize Private Config
|
|
117
|
+
|
|
118
|
+
Run the bootstrap command to create owner-only (`0600`) config files in `~/.config/unhoard/` (never committed to Git):
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
uv run unhoard init
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Edit `~/.config/unhoard/notion.env` and paste your Notion credentials:
|
|
125
|
+
|
|
126
|
+
```env
|
|
127
|
+
NOTION_API_KEY=ntn_...
|
|
128
|
+
NOTION_DATABASE_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
See [`config.example.toml`](config.example.toml) for all options in `~/.config/unhoard/config.toml` (deck size, enrichment model, optional OpenMail settings).
|
|
132
|
+
|
|
133
|
+
### 4. Sync, Unfurl Links, and Enrich
|
|
134
|
+
|
|
135
|
+
Start with a small batch (e.g. your 30 newest bookmarks) to verify everything end-to-end:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 1. Sync all database rows + fetch nested thread blocks for the first 30
|
|
139
|
+
uv run unhoard sync --limit 30
|
|
140
|
+
|
|
141
|
+
# 2. Unfurl linked arXiv papers, HuggingFace Papers, GitHub repos, and article titles
|
|
142
|
+
uv run unhoard unfurl --limit 30
|
|
143
|
+
|
|
144
|
+
# 3. Generate clean titles, 2-sentence TL;DRs, takeaways, signal scores, and tags
|
|
145
|
+
uv run unhoard enrich --limit 30
|
|
146
|
+
# Or use Claude instead of Codex:
|
|
147
|
+
# uv run unhoard enrich --provider claude --model claude-opus-5-5 --limit 30
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Once you're happy with the output, run the full backfill (safe to stop and resume at any time):
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
make sync
|
|
154
|
+
make unfurl
|
|
155
|
+
make enrich
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
*(Optional)* Push the generated tags back into Notion's `Tags` multi-select column:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
make push-tags
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 5. Launch the Readwise-Style Dashboard
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
make serve
|
|
168
|
+
# Opens on http://127.0.0.1:8765
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Keyboard shortcuts:**
|
|
172
|
+
|
|
173
|
+
| Key | Action |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `j` / `k` | Move to next / previous card |
|
|
176
|
+
| `Space` | Expand / collapse full post or thread reader |
|
|
177
|
+
| `d` | Mark **Done** (syncs `Done Reading? → Done` back to Notion) |
|
|
178
|
+
| `s` | Save to **Deep Read** queue |
|
|
179
|
+
| `z` | **Snooze** for 14 days (resurfaces automatically later) |
|
|
180
|
+
| `x` | **Skip / Archive** locally |
|
|
181
|
+
| `o` | Open primary link (paper / repo / article) |
|
|
182
|
+
| `t` | Open original tweet |
|
|
183
|
+
|
|
184
|
+
Use the **`Aa`** button in the top bar to switch reader typography between **Sans** (`Inter`), **Serif** (`Newsreader`), and **Quattro** (`iA Writer Quattro`), and **`◐`** to toggle Light/Dark mode.
|
|
185
|
+
|
|
186
|
+
### Long Video Auto-Transcription & Summaries (> 30 min)
|
|
187
|
+
|
|
188
|
+
Whenever you expand a post containing an embedded video longer than **30 minutes** (configurable via `long_video_minutes` in `config.toml`), the dashboard automatically extracts audio via `ffmpeg`, transcribes locally with `faster-whisper` (or grabs YouTube captions via `yt-dlp`), and generates an executive summary, key takeaways, and **clickable timestamped chapters** that seek the inline video player. Results are cached in SQLite and indexed in FTS5. You can also run batch transcription from the CLI:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
uv sync --extra transcribe
|
|
192
|
+
uv run unhoard transcribe
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Connecting the MCP Server
|
|
198
|
+
|
|
199
|
+
Point any stdio MCP client (Claude Code, Codex, Antigravity, Cursor, etc.) at the installed entrypoint:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"mcpServers": {
|
|
204
|
+
"notion-bookmarks": {
|
|
205
|
+
"command": "/absolute/path/to/unhoard/.venv/bin/unhoard",
|
|
206
|
+
"args": ["mcp"]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Exposed MCP Tools
|
|
213
|
+
|
|
214
|
+
| Tool | Description |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `search_bookmarks` | Full-text FTS5 + facet search (`query`, `kind`, `tag`, `author`, `review_state`, `year`, `min_signal`) across full threads, quote-tweets, unfurled titles, and notes |
|
|
217
|
+
| `get_bookmark` | Read a single bookmark in full (entire thread text, external URLs, unfurled metadata, media, personal note) |
|
|
218
|
+
| `get_daily_review` | Return today's capped Readwise-style daily review deck |
|
|
219
|
+
| `list_deep_reads` | List bookmarks saved to your Deep Read queue |
|
|
220
|
+
| `mark_bookmark` | Update triage state (`unread`/`done`/`deep_read`/`snoozed`/`archived`) + note, optionally syncing `Done Reading?` to Notion |
|
|
221
|
+
| `get_vault_stats` | Counts by status, kind, year, top tags, and top authors |
|
|
222
|
+
| `sync_notion` | Run an incremental Notion sync on demand |
|
|
223
|
+
| `transcribe_long_video` | Probe video duration and transcribe + summarize videos >30 min (or with `force=True`) |
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Weekend Push Email Digests (Optional)
|
|
228
|
+
|
|
229
|
+
You can preview a themed HTML + Markdown digest locally without configuring email:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
uv run unhoard digest
|
|
233
|
+
# Saves preview to ~/.local/state/unhoard/digests/digest-YYYY-MM-DD.html
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Digests adapt by day of week:
|
|
237
|
+
- **Friday:** *Friday Warmup* (fresh saves + quick high-signal hits)
|
|
238
|
+
- **Saturday:** *Saturday Deep Dive* (papers, repos, and technical threads)
|
|
239
|
+
- **Sunday:** *Sunday Vault Gems* (resurfaced older classics + a Weekend Deep Read Spotlight)
|
|
240
|
+
|
|
241
|
+
To send via [OpenMail](https://openmail.sh/):
|
|
242
|
+
1. Create `~/.config/unhoard/openmail.env` (`chmod 600`) with `OPENMAIL_API_KEY=...` and `OPENMAIL_INBOX_ID=...`.
|
|
243
|
+
2. Set `openmail_env` and `recipient_email` in `~/.config/unhoard/config.toml`.
|
|
244
|
+
3. Send a test digest:
|
|
245
|
+
```bash
|
|
246
|
+
uv run unhoard digest --send
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Optional: Linux `systemd` User Services
|
|
250
|
+
|
|
251
|
+
Unit templates for keeping the dashboard running and emailing every **Fri / Sat / Sun at 08:30** live in [`deploy/`](deploy/):
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
mkdir -p ~/.config/systemd/user
|
|
255
|
+
cp deploy/unhoard-*.service deploy/unhoard-*.timer ~/.config/systemd/user/
|
|
256
|
+
# Edit paths/PATH in ~/.config/systemd/user/unhoard-*.service if needed
|
|
257
|
+
systemctl --user daemon-reload
|
|
258
|
+
systemctl --user enable --now unhoard-web.service
|
|
259
|
+
systemctl --user enable --now unhoard-digest.timer
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Expected Notion Database Schema
|
|
265
|
+
|
|
266
|
+
Built around [Tweetsmash](https://www.tweetsmash.com/)'s default Notion export schema:
|
|
267
|
+
|
|
268
|
+
| Property | Type | Usage |
|
|
269
|
+
|---|---|---|
|
|
270
|
+
| `Tweet` | `title` | Read (raw first-line title) |
|
|
271
|
+
| `Author` | `rich_text` | Read |
|
|
272
|
+
| `Tweet Link` | `url` | Read |
|
|
273
|
+
| `Type` | `select` | Read (`Tweet`, `Thread`, `Conversation`) |
|
|
274
|
+
| `Tweet Posted At` | `date` | Read |
|
|
275
|
+
| `App Imported Time` | `date` | Read |
|
|
276
|
+
| `Done Reading?` | `select` | **Read & Write** (`Done` / `Pending`) |
|
|
277
|
+
| `Tags` | `multi_select` | **Read & Write** (populated via `--push-tags` or `push-tags`) |
|
|
278
|
+
| Page Body | nested `callout` / `image` / `video` blocks | Read recursively (threads & quote-tweets) |
|
|
279
|
+
|
|
280
|
+
Missing optional properties degrade gracefully.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# unhoard
|
|
2
|
+
|
|
3
|
+
Turn an overgrown Notion Twitter/X bookmarks database (exported via [Tweetsmash](https://www.tweetsmash.com/) or similar) into something you can actually keep up with:
|
|
4
|
+
|
|
5
|
+
1. **Readwise-style Daily Review Dashboard** — a calm, keyboard-driven local web UI showing a capped **5-card daily deck** (2 Fresh + 2 Vault Gems + 1 Wildcard), full thread & nested quote-tweet reader, Deep Read queue, and instant full-text search across your entire backlog.
|
|
6
|
+
2. **Weekend Push Email Digest (Fri–Sat–Sun)** — a short, Outlook-safe HTML brief curated from your unread vault so you steadily chip away at papers, repos, and threads without opening another app.
|
|
7
|
+
3. **Local MCP Server (`unhoard`)** — exposes your synced, enriched bookmark vault to coding agents (Claude Code, Codex, Antigravity, Cursor, etc.) so you can ask *"what did I bookmark about X?"* on demand.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Screenshots
|
|
12
|
+
|
|
13
|
+
### Daily Review (Light Mode)
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
### Expanded Thread Reader
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
### Explore Vault (Dark Mode & Instant FTS5 Search)
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
### Weekend Push Email Digest Preview
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Why a Local SQLite Cache?
|
|
28
|
+
|
|
29
|
+
Notion's API rate-limits recursive block reads (~3 req/sec) and its built-in search doesn't index nested callout blocks well. `unhoard` syncs your Notion database and nested Tweetsmash callout trees **once** into a local SQLite + FTS5 database (`~/.local/state/unhoard/bookmarks.sqlite3`), then runs incremental syncs for new saves.
|
|
30
|
+
|
|
31
|
+
**Safe Notion write-back:** `unhoard` only ever writes to two existing Notion columns—**`Done Reading?`** (`Done` / `Pending`) and **`Tags`** (multi-select)—so your bookmark exporter never breaks. Local review states (`Deep Read`, `Snooze`, `Archived`), TL;DRs, signal scores, and personal notes live in SQLite.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Prerequisites
|
|
36
|
+
|
|
37
|
+
- **Python 3.11+** and **[`uv`](https://docs.astral.sh/uv/)**
|
|
38
|
+
- A **Notion** database of exported Twitter/X bookmarks (tested with Tweetsmash's default schema)
|
|
39
|
+
- **Optional (for AI TL;DRs & auto-tagging):** either the [Codex CLI](https://github.com/openai/codex) (`codex`) or [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
|
|
40
|
+
- **Optional (for >30 min video transcription & summaries):** `ffmpeg` / `ffprobe` (plus `yt-dlp` for YouTube captions) and `uv sync --extra transcribe` (`faster-whisper`)
|
|
41
|
+
- **Optional (for weekend push email digests):** [OpenMail CLI](https://openmail.sh/) (`openmail`)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Setup Guide
|
|
46
|
+
|
|
47
|
+
### 1. Create a Notion Internal Integration
|
|
48
|
+
|
|
49
|
+
1. Go to [notion.so/profile/integrations](https://www.notion.so/profile/integrations) and click **New integration**.
|
|
50
|
+
2. Name it anything (e.g. `bookmarks-vault`), choose your workspace, and keep **Read content** and **Update content** enabled.
|
|
51
|
+
3. Copy the **Internal Integration Secret** (starts with `ntn_` or `secret_`).
|
|
52
|
+
4. Open your bookmarks database in Notion → click **`···`** (top right) → **Connections** → add your new integration.
|
|
53
|
+
5. Copy the **32-character database ID** from your database URL:
|
|
54
|
+
```text
|
|
55
|
+
https://www.notion.so/<workspace>/<DATABASE_ID>?v=<view_id>
|
|
56
|
+
^^^^^^^^^^^^ 32 hex chars
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 2. Install
|
|
60
|
+
|
|
61
|
+
**From PyPI (recommended):**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# With uv (recommended)
|
|
65
|
+
uv tool install unhoard-cli
|
|
66
|
+
# Or with local Whisper transcription for >30m videos:
|
|
67
|
+
uv tool install "unhoard-cli[transcribe]"
|
|
68
|
+
|
|
69
|
+
# Or with pip
|
|
70
|
+
pip install unhoard-cli
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Or from source:**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/deven367/unhoard.git
|
|
77
|
+
cd unhoard
|
|
78
|
+
uv sync --extra dev --extra transcribe
|
|
79
|
+
uv run pytest -q
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Initialize Private Config
|
|
83
|
+
|
|
84
|
+
Run the bootstrap command to create owner-only (`0600`) config files in `~/.config/unhoard/` (never committed to Git):
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv run unhoard init
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Edit `~/.config/unhoard/notion.env` and paste your Notion credentials:
|
|
91
|
+
|
|
92
|
+
```env
|
|
93
|
+
NOTION_API_KEY=ntn_...
|
|
94
|
+
NOTION_DATABASE_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
See [`config.example.toml`](config.example.toml) for all options in `~/.config/unhoard/config.toml` (deck size, enrichment model, optional OpenMail settings).
|
|
98
|
+
|
|
99
|
+
### 4. Sync, Unfurl Links, and Enrich
|
|
100
|
+
|
|
101
|
+
Start with a small batch (e.g. your 30 newest bookmarks) to verify everything end-to-end:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# 1. Sync all database rows + fetch nested thread blocks for the first 30
|
|
105
|
+
uv run unhoard sync --limit 30
|
|
106
|
+
|
|
107
|
+
# 2. Unfurl linked arXiv papers, HuggingFace Papers, GitHub repos, and article titles
|
|
108
|
+
uv run unhoard unfurl --limit 30
|
|
109
|
+
|
|
110
|
+
# 3. Generate clean titles, 2-sentence TL;DRs, takeaways, signal scores, and tags
|
|
111
|
+
uv run unhoard enrich --limit 30
|
|
112
|
+
# Or use Claude instead of Codex:
|
|
113
|
+
# uv run unhoard enrich --provider claude --model claude-opus-5-5 --limit 30
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Once you're happy with the output, run the full backfill (safe to stop and resume at any time):
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
make sync
|
|
120
|
+
make unfurl
|
|
121
|
+
make enrich
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
*(Optional)* Push the generated tags back into Notion's `Tags` multi-select column:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
make push-tags
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 5. Launch the Readwise-Style Dashboard
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
make serve
|
|
134
|
+
# Opens on http://127.0.0.1:8765
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Keyboard shortcuts:**
|
|
138
|
+
|
|
139
|
+
| Key | Action |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `j` / `k` | Move to next / previous card |
|
|
142
|
+
| `Space` | Expand / collapse full post or thread reader |
|
|
143
|
+
| `d` | Mark **Done** (syncs `Done Reading? → Done` back to Notion) |
|
|
144
|
+
| `s` | Save to **Deep Read** queue |
|
|
145
|
+
| `z` | **Snooze** for 14 days (resurfaces automatically later) |
|
|
146
|
+
| `x` | **Skip / Archive** locally |
|
|
147
|
+
| `o` | Open primary link (paper / repo / article) |
|
|
148
|
+
| `t` | Open original tweet |
|
|
149
|
+
|
|
150
|
+
Use the **`Aa`** button in the top bar to switch reader typography between **Sans** (`Inter`), **Serif** (`Newsreader`), and **Quattro** (`iA Writer Quattro`), and **`◐`** to toggle Light/Dark mode.
|
|
151
|
+
|
|
152
|
+
### Long Video Auto-Transcription & Summaries (> 30 min)
|
|
153
|
+
|
|
154
|
+
Whenever you expand a post containing an embedded video longer than **30 minutes** (configurable via `long_video_minutes` in `config.toml`), the dashboard automatically extracts audio via `ffmpeg`, transcribes locally with `faster-whisper` (or grabs YouTube captions via `yt-dlp`), and generates an executive summary, key takeaways, and **clickable timestamped chapters** that seek the inline video player. Results are cached in SQLite and indexed in FTS5. You can also run batch transcription from the CLI:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
uv sync --extra transcribe
|
|
158
|
+
uv run unhoard transcribe
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Connecting the MCP Server
|
|
164
|
+
|
|
165
|
+
Point any stdio MCP client (Claude Code, Codex, Antigravity, Cursor, etc.) at the installed entrypoint:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"notion-bookmarks": {
|
|
171
|
+
"command": "/absolute/path/to/unhoard/.venv/bin/unhoard",
|
|
172
|
+
"args": ["mcp"]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Exposed MCP Tools
|
|
179
|
+
|
|
180
|
+
| Tool | Description |
|
|
181
|
+
|---|---|
|
|
182
|
+
| `search_bookmarks` | Full-text FTS5 + facet search (`query`, `kind`, `tag`, `author`, `review_state`, `year`, `min_signal`) across full threads, quote-tweets, unfurled titles, and notes |
|
|
183
|
+
| `get_bookmark` | Read a single bookmark in full (entire thread text, external URLs, unfurled metadata, media, personal note) |
|
|
184
|
+
| `get_daily_review` | Return today's capped Readwise-style daily review deck |
|
|
185
|
+
| `list_deep_reads` | List bookmarks saved to your Deep Read queue |
|
|
186
|
+
| `mark_bookmark` | Update triage state (`unread`/`done`/`deep_read`/`snoozed`/`archived`) + note, optionally syncing `Done Reading?` to Notion |
|
|
187
|
+
| `get_vault_stats` | Counts by status, kind, year, top tags, and top authors |
|
|
188
|
+
| `sync_notion` | Run an incremental Notion sync on demand |
|
|
189
|
+
| `transcribe_long_video` | Probe video duration and transcribe + summarize videos >30 min (or with `force=True`) |
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Weekend Push Email Digests (Optional)
|
|
194
|
+
|
|
195
|
+
You can preview a themed HTML + Markdown digest locally without configuring email:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
uv run unhoard digest
|
|
199
|
+
# Saves preview to ~/.local/state/unhoard/digests/digest-YYYY-MM-DD.html
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Digests adapt by day of week:
|
|
203
|
+
- **Friday:** *Friday Warmup* (fresh saves + quick high-signal hits)
|
|
204
|
+
- **Saturday:** *Saturday Deep Dive* (papers, repos, and technical threads)
|
|
205
|
+
- **Sunday:** *Sunday Vault Gems* (resurfaced older classics + a Weekend Deep Read Spotlight)
|
|
206
|
+
|
|
207
|
+
To send via [OpenMail](https://openmail.sh/):
|
|
208
|
+
1. Create `~/.config/unhoard/openmail.env` (`chmod 600`) with `OPENMAIL_API_KEY=...` and `OPENMAIL_INBOX_ID=...`.
|
|
209
|
+
2. Set `openmail_env` and `recipient_email` in `~/.config/unhoard/config.toml`.
|
|
210
|
+
3. Send a test digest:
|
|
211
|
+
```bash
|
|
212
|
+
uv run unhoard digest --send
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Optional: Linux `systemd` User Services
|
|
216
|
+
|
|
217
|
+
Unit templates for keeping the dashboard running and emailing every **Fri / Sat / Sun at 08:30** live in [`deploy/`](deploy/):
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
mkdir -p ~/.config/systemd/user
|
|
221
|
+
cp deploy/unhoard-*.service deploy/unhoard-*.timer ~/.config/systemd/user/
|
|
222
|
+
# Edit paths/PATH in ~/.config/systemd/user/unhoard-*.service if needed
|
|
223
|
+
systemctl --user daemon-reload
|
|
224
|
+
systemctl --user enable --now unhoard-web.service
|
|
225
|
+
systemctl --user enable --now unhoard-digest.timer
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Expected Notion Database Schema
|
|
231
|
+
|
|
232
|
+
Built around [Tweetsmash](https://www.tweetsmash.com/)'s default Notion export schema:
|
|
233
|
+
|
|
234
|
+
| Property | Type | Usage |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| `Tweet` | `title` | Read (raw first-line title) |
|
|
237
|
+
| `Author` | `rich_text` | Read |
|
|
238
|
+
| `Tweet Link` | `url` | Read |
|
|
239
|
+
| `Type` | `select` | Read (`Tweet`, `Thread`, `Conversation`) |
|
|
240
|
+
| `Tweet Posted At` | `date` | Read |
|
|
241
|
+
| `App Imported Time` | `date` | Read |
|
|
242
|
+
| `Done Reading?` | `select` | **Read & Write** (`Done` / `Pending`) |
|
|
243
|
+
| `Tags` | `multi_select` | **Read & Write** (populated via `--push-tags` or `push-tags`) |
|
|
244
|
+
| Page Body | nested `callout` / `image` / `video` blocks | Read recursively (threads & quote-tweets) |
|
|
245
|
+
|
|
246
|
+
Missing optional properties degrade gracefully.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copy to ~/.config/unhoard/config.toml (chmod 600) or run `uv run unhoard init`
|
|
2
|
+
|
|
3
|
+
notion_env = "~/.config/unhoard/notion.env"
|
|
4
|
+
state_dir = "~/.local/state/unhoard"
|
|
5
|
+
dashboard_url = "http://127.0.0.1:8765"
|
|
6
|
+
|
|
7
|
+
# Number of cards in your daily Readwise-style review deck
|
|
8
|
+
daily_deck_size = 5
|
|
9
|
+
|
|
10
|
+
# Number of main picks (+ 1 Weekend Deep Read Spotlight) in each push digest
|
|
11
|
+
digest_items = 4
|
|
12
|
+
|
|
13
|
+
# Batch LLM enrichment backend:
|
|
14
|
+
# codex -> uses `codex exec` (e.g. "gpt-6.2-sol")
|
|
15
|
+
# claude -> uses `claude -p` (e.g. "claude-opus-5-5")
|
|
16
|
+
enrich_provider = "codex"
|
|
17
|
+
enrich_model = "gpt-6.2-sol"
|
|
18
|
+
|
|
19
|
+
# Auto-transcribe & summarize bookmarked videos longer than this threshold (minutes)
|
|
20
|
+
long_video_minutes = 30
|
|
21
|
+
whisper_model = "base.en"
|
|
22
|
+
|
|
23
|
+
# Optional: OpenMail delivery for Fri-Sat-Sun push email digests
|
|
24
|
+
# openmail_env = "~/.config/unhoard/openmail.env"
|
|
25
|
+
# recipient_email = "you@example.com"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=unhoard Fri-Sat-Sun Bookmark Email Digest
|
|
3
|
+
After=network-online.target
|
|
4
|
+
|
|
5
|
+
[Service]
|
|
6
|
+
Type=oneshot
|
|
7
|
+
# Adjust WorkingDirectory, ExecStart, and PATH to match where you installed unhoard, openmail, and codex/claude
|
|
8
|
+
WorkingDirectory=%h/projects/unhoard
|
|
9
|
+
Environment="PATH=%h/.local/bin:/usr/local/bin:/usr/bin:/bin"
|
|
10
|
+
ExecStart=%h/projects/unhoard/.venv/bin/unhoard digest --sync-first --send
|