自动化与脚本
需要通过命令行访问和操作 Readwise 高亮与…
当已安装并认证 Readwise CLI,需在命令行中搜索、浏览、保存、标注、组织、导出 Readwise 高亮或 Reader 文档时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 60/100 ×0.15
适用场景
需要通过命令行访问和操作 Readwis特定
解决思路
- 安装:若 `readwise` 未安装,运行 `npm install -g @readwise/cli`。
- 认证:若未认证,向用户索取 Readwise access token(获取地址 https://readwise.io/access_token),然后运行 `readwise login-with-token <token>`。
- 发现命令:每个命令都支持 `--help`,例如 `readwise --help`、`readwise reader-search-documents --help`、`readwise readwise-list-highlights --help`。
- 机器可读输出:任意命令加 `--json` 获取机器可读输出;使用 `--refresh` 强制刷新缓存数据。
- Reader 语义搜索文档:运行 `readwise reader-search-documents --query "spaced repetition"`。
- Reader 限定搜索:只搜索稍后读文章:`readwise reader-search-documents --query "machine learning" --category-in article --location-in later,shortlist`。
- Reader 按作者搜索收件箱:`readwise reader-search-documents --query "AI" --author-search "Simon Willison" --location-in new`。
- Reader 按发布日期搜索:`readwise reader-search-documents --query "transformers" --published-date-gt 2024-01-01`。
- Reader 浏览文档:列出 10 条最新收件箱条目并只返回少量字段省 token:`readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at`。
- Reader 浏览归档且带 `research` 标签的文章:`readwise reader-list-documents --location archive --tag research --category article`。
- Reader 列出未读收件箱文档:`readwise reader-list-documents --location new --seen false`。
- Reader 列出 RSS feed 条目:`readwise reader-list-documents --location feed --limit 20 --response-fields title,author,summary,site_name`。
- Reader 按 ID 获取特定文档:`readwise reader-list-documents --id <document_id>`。
- Reader 位置映射:`new`(收件箱)、`later`、`shortlist`、`archive`、`feed`;用户说 “inbox” 时使用 `new`。
- Reader 读取文档:获取完整文档内容为 Markdown:`readwise reader-get-document-details --document-id <id>`。
- Reader 获取某文档全部高亮:`readwise reader-get-document-highlights --document-id <id>`。
- Reader 创建高亮:`readwise reader-create-highlight --document-id <id> --html-content "<p>The exact passage to highlight</p>"`;`html-content` 必须与文档 HTML 完全匹配,先通过 `readwise reader-list-documents --response-fields html_content` 获取 HTML。
- Reader 创建带笔记和标签的高亮:`readwise reader-create-highlight --document-id <id> --html-content "<p>Key insight</p>" --note "Connects to spaced repetition research" --tags review,concept`。
- Reader 保存 URL:`readwise reader-create-document --url "https://example.com/article"`,Reader 会自动抓取内容。
- Reader 保存 URL 并带元数据:`readwise reader-create-document --url "https://example.com" --title "Great Article" --tags research,ai --notes "Recommended by Alice"`。
- Reader 保存原始 Markdown 内容:提供唯一 URL 作为标识:`readwise reader-create-document --title "Meeting Notes" --markdown "# Notes from today..." --url "https://me.com#notes-march-2025"`。
- Reader 移动文档:`readwise reader-move-documents --document-ids <id1>,<id2> --location archive` 或 `readwise reader-move-documents --document-ids <id> --location later`,每次最多 50 个。
- Reader 批量标记已见:`readwise reader-bulk-edit-document-metadata --documents '[{"document_id": "<id>", "seen": true}]'`。
- Reader 批量更新元数据:`readwise reader-bulk-edit-document-metadata --documents '[{"document_id": "<id>", "title": "Better Title", "tags": ["ai", "research"]}]'`,可更新 title、author、tags、summary 等。
- Reader 标签管理:列出标签 `readwise reader-list-tags`;给文档加标签 `readwise reader-add-tags-to-document --document-id <id> --tag-names important,research`;从文档移除标签 `readwise reader-remove-tags-from-document --document-id <id> --tag-names old-tag`。
- Reader 高亮标签和笔记管理:给高亮加标签 `readwise reader-add-tags-to-highlight --document-id <id> --highlight-document-id <hid> --tag-names concept`;从高亮移除标签 `readwise reader-remove-tags-from-highlight --document-id <id> --highlight-document-id <hid> --tag-names old-tag`;设置高亮笔记 `readwise reader-set-highlight-notes --document-id <id> --highlight-document-id <hid> --notes "Updated note"`。
- Reader 导出全部文档:运行 `readwise reader-export-documents` 异步导出为 Markdown 文件 ZIP,再用 `readwise reader-get-export-documents-status --export-id <id>` 查询状态。
- Reader 增量导出:只导出自上次导出后更新的文档:`readwise reader-export-documents --since-updated "2024-01-01T00:00:00Z"`。
- Readwise 搜索高亮:语义搜索所有高亮:`readwise readwise-search-highlights --vector-search-term "learning techniques"`。
- Readwise 带全文过滤搜索高亮:`readwise readwise-search-highlights --vector-search-term "memory" --full-text-queries '[{"field_name": "document_title", "search_term": "psychology"}]'`。
- Readwise 全文查询可用字段:`document_author`、`document_title`、`highlight_note`、`highlight_plaintext`、`highlight_tags`。
- Readwise 浏览高亮:列出最近 20 条高亮:`readwise readwise-list-highlights --page-size 20`。
- Readwise 按书浏览高亮:`readwise readwise-list-highlights --book-id <id>`。
- Readwise 按时间浏览高亮:列出最近一个月:`readwise readwise-list-highlights --highlighted-at-gt "2025-02-01T00:00:00Z"`。
- Readwise 创建高亮:按 title/author 匹配书籍,否则进入 “Quotes”:`readwise readwise-create-highlights --highlights '[{"text": "The key insight here", "title": "Book Title", "author": "Author Name"}]'`。
- Readwise 批量创建高亮:`readwise readwise-create-highlights --highlights '[{"text": "First quote", "title": "Book A"}, {"text": "Second quote", "title": "Book B"}]'`。
- Readwise 更新高亮:更新文本、笔记、颜色、标签:`readwise readwise-update-highlight --highlight-id <id> --note "New note" --add-tags concept,review --color blue`。
- Readwise 删除高亮:`readwise readwise-delete-highlight --highlight-id <id>`。
- Readwise 颜色可用值:`yellow`、`blue`、`pink`、`orange`、`green`、`purple`。
- Readwise 每日回顾:获取今天的间隔重复复习:`readwise readwise-get-daily-review`,返回按算法选出的高亮和交互式复习 URL。
- 示例工作流—整理收件箱:列出最近保存项 `readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at`;逐条读取 `readwise reader-get-document-details --document-id <id>`;值得读则 `readwise reader-move-documents --document-ids <id> --location later`;跳过则 `readwise reader-move-documents --document-ids <id> --location archive`。
- 示例工作流—跨库搜索一切:用 `readwise reader-search-documents --query "spaced repetition"` 搜文档,用 `readwise readwise-search-highlights --vector-search-term "spaced repetition"` 搜高亮。
- 示例工作流—针对最近读完的内容测验:列出归档文档 `readwise reader-list-documents --location archive --limit 10 --response-fields title,author,summary,word_count`;获取内容 `readwise reader-get-document-details --document-id <id>`;获取高亮 `readwise reader-get-document-highlights --document-id <id>`;再向用户提问。
- 示例工作流—追读 RSS:浏览 feed `readwise reader-list-documents --location feed --limit 20 --response-fields title,author,summary,word_count,site_name`;把其余标为已见 `readwise reader-bulk-edit-document-metadata --documents '[{"document_id": "<id>", "seen": true}]'`;把值得读的移到 later `readwise reader-move-documents --document-ids <id> --location later`。
- 示例工作流—保存并批注:保存 URL `readwise reader-create-document --url "https://example.com/article" --tags research`;创建高亮 `readwise reader-create-highlight --document-id <id> --html-content "<p>Key passage here</p>" --note "This connects to..."`;给文档加标签 `readwise reader-add-tags-to-document --document-id <id> --tag-names important`。
- 示例工作流—生成阅读回顾:列出最近完成并更新的归档文档 `readwise reader-list-documents --location archive --updated-after "2025-03-10T00:00:00Z" --response-fields title,author,word_count,reading_progress`;获取其高亮 `readwise reader-get-document-highlights --document-id <id>`;列出最近 Readwise 高亮 `readwise readwise-list-highlights --highlighted-at-gt "2025-03-10T00:00:00Z" --page-size 50`。
适用边界 · 注意事项
- 未安装 `@readwise/cli` 或没有 Readwise 账号/access token 时不可用。
- 需要操作非 Readwise/Reader 的阅读数据、本地文件或其他阅读服务时不可用。
- 不想使用命令行、无法提供 access token 或需要完全手动浏览器操作时避免使用。