关于 readwise-cli
readwise-cli 是访问 Readwise 摘录和 Reader 文档的命令行工具,适合管理阅读资料与摘录的用户。它支持语义搜索、内容整理、标注和导出,并可用 JSON 输出供机器处理。
主要功能
- 01搜索文档与摘录
- 02浏览和读取 Reader 文档
- 03创建文档与摘录
- 04整理位置、标签和元数据
- 05导出 Markdown 文档
适用场景
- 01查找某主题的保存文章与摘录
- 02整理 Reader 收件箱
- 03复习近期摘录
- 04导出文档用于归档
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ readwiseio/ readwise-skills --skill readwise-cli安装后在 Claude Code 中输入/readwise-cli确认已加载。
详细介绍
Readwise CLI
使用 readwise 命令访问用户的 Readwise 高亮内容和 Reader 文档。Readwise 有两款产品:
- Readwise — 来自书籍、文章、播客等内容的高亮。包含每日复习和间隔重复。
- Reader — 一款稍后阅读应用,可保存和阅读文章、PDF、EPUB、RSS 订阅、电子邮件、推文和视频。
设置
如果尚未安装 readwise:
npm install -g @readwise/cli
如果尚未通过身份验证,请向用户索取其 Readwise 访问令牌(可在 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 命令
搜索文档
# Semantic search across all saved documents
readwise reader-search-documents --query "spaced repetition"
# Search only articles saved for later
readwise reader-search-documents --query "machine learning" --category-in article --location-in later,shortlist
# Search by author within the inbox
readwise reader-search-documents --query "AI" --author-search "Simon Willison" --location-in new
# Search documents published after a date
readwise reader-search-documents --query "transformers" --published-date-gt 2024-01-01
浏览文档
# List 10 most recent inbox items (minimal fields to save tokens)
readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at
# List archived articles tagged "research"
readwise reader-list-documents --location archive --tag research --category article
# List unseen documents in the inbox
readwise reader-list-documents --location new --seen false
# List RSS feed items
readwise reader-list-documents --location feed --limit 20 --response-fields title,author,summary,site_name
# Get a specific document by ID
readwise reader-list-documents --id <document_id>
位置:new(收件箱)、later、shortlist、archive、feed。用户说“收件箱”时,请使用 new。
阅读和高亮
# Get full document content as Markdown
readwise reader-get-document-details --document-id <id>
# Get all highlights on a document
readwise reader-get-document-highlights --document-id <id>
# Highlight a passage (html-content must match the document's HTML exactly)
# Get the HTML first via reader-list-documents with --response-fields html_content
readwise reader-create-highlight --document-id <id> --html-content "<p>The exact passage to highlight</p>"
# Highlight with a note and tags
readwise reader-create-highlight --document-id <id> --html-content "<p>Key insight</p>" --note "Connects to spaced repetition research" --tags review,concept
保存文档
# Save a URL — Reader scrapes it automatically
readwise reader-create-document --url "https://example.com/article"
# Save with metadata
readwise reader-create-document --url "https://example.com" --title "Great Article" --tags research,ai --notes "Recommended by Alice"
# Save raw Markdown content (provide a unique URL as identifier)
readwise reader-create-document --title "Meeting Notes" --markdown "# Notes from today..." --url "https://me.com#notes-march-2025"
整理
# Move documents between locations (max 50 per call)
readwise reader-move-documents --document-ids <id1>,<id2> --location archive
readwise reader-move-documents --document-ids <id> --location later
# Bulk mark documents as seen
readwise reader-bulk-edit-document-metadata --documents '[{"document_id": "<id>", "seen": true}]'
# Bulk update metadata (title, author, tags, summary, etc.)
readwise reader-bulk-edit-document-metadata --documents '[{"document_id": "<id>", "title": "Better Title", "tags": ["ai", "research"]}]'
# Tags
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
# Highlight tags and notes
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"
导出
# Export all documents as a ZIP of Markdown files (async)
readwise reader-export-documents
readwise reader-get-export-documents-status --export-id <id>
# Delta export — only docs updated since last export
readwise reader-export-documents --since-updated "2024-01-01T00:00:00Z"
Readwise 命令
搜索高亮
# Semantic search across all highlights
readwise readwise-search-highlights --vector-search-term "learning techniques"
# Search with full-text filter on a specific field
readwise readwise-search-highlights --vector-search-term "memory" --full-text-queries '[{"field_name": "document_title", "search_term": "psychology"}]'
全文搜索字段:document_author、document_title、highlight_note、highlight_plaintext、highlight_tags。
浏览高亮
# List 20 most recent highlights
readwise readwise-list-highlights --page-size 20
# Highlights from a specific book
readwise readwise-list-highlights --book-id <id>
# Highlights from the last month
readwise readwise-list-highlights --highlighted-at-gt "2025-02-01T00:00:00Z"
创建和编辑高亮
# Create a highlight (matched to a book by title/author, or goes into "Quotes")
readwise readwise-create-highlights --highlights '[{"text": "The key insight here", "title": "Book Title", "author": "Author Name"}]'
# Create multiple highlights at once
readwise readwise-create-highlights --highlights '[{"text": "First quote", "title": "Book A"}, {"text": "Second quote", "title": "Book B"}]'
# Update a highlight — text, note, color, tags
readwise readwise-update-highlight --highlight-id <id> --note "New note" --add-tags concept,review --color blue
# Delete a highlight
readwise readwise-delete-highlight --highlight-id <id>
颜色:yellow、blue、pink、orange、green、purple。
每日复习
# Get today's spaced repetition review
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 # worth reading
readwise reader-move-documents --document-ids <id> --location archive # skip
搜索所有内容: 在高亮和文档中查找与某个主题相关的所有内容。
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: 浏览订阅源条目,挑选最值得一看的内容,并将其余内容标记为已查看。
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}]'
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-list-highlights --highlighted-at-gt "2025-03-10T00:00:00Z" --page-size 50