readwise-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Readwise CLI

Readwise CLI

Use the
readwise
command to access the user's Readwise highlights and Reader documents. Readwise has two products:
  • Readwise — highlights from books, articles, podcasts, and more. Includes daily review and spaced repetition.
  • Reader — a read-later app for saving and reading articles, PDFs, EPUBs, RSS feeds, emails, tweets, and videos.
使用
readwise
命令访问用户的Readwise高亮内容和Reader文档。Readwise有两款产品:
  • Readwise —— 来自书籍、文章、播客等内容的高亮标记。包含每日复习和间隔重复功能。
  • Reader —— 一款稍后阅读应用,用于保存和阅读文章、PDF、EPUB、RSS订阅、邮件、推文和视频。

Setup

安装配置

If
readwise
is not installed:
bash
npm install -g @readwise/cli
If not authenticated, ask the user for their Readwise access token (they can get one at https://readwise.io/access_token), then run:
bash
readwise login-with-token <token>
如果未安装
readwise
bash
npm install -g @readwise/cli
如果未进行身份验证,请向用户索要其Readwise访问令牌(可在https://readwise.io/access_token获取),然后运行:
bash
readwise login-with-token <token>

Discovering Commands

探索命令

Every command supports
--help
for full option details:
bash
readwise --help
readwise reader-search-documents --help
readwise readwise-list-highlights --help
Add
--json
to any command for machine-readable output. Use
--refresh
to force-refresh cached data.
每个命令都支持
--help
查看完整选项详情:
bash
readwise --help
readwise reader-search-documents --help
readwise readwise-list-highlights --help
在任意命令后添加
--json
可获取机器可读格式的输出。使用
--refresh
可强制刷新缓存数据。

Reader Commands

Reader 命令

Searching documents

搜索文档

bash
undefined
bash
undefined

Semantic search across all saved documents

在所有已保存文档中进行语义搜索

readwise reader-search-documents --query "spaced repetition"
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
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
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
undefined
readwise reader-search-documents --query "transformers" --published-date-gt 2024-01-01
undefined

Browsing documents

浏览文档

bash
undefined
bash
undefined

List 10 most recent inbox items (minimal fields to save tokens)

列出10条最新收件箱项目(仅显示必要字段以节省令牌)

readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at
readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at

List archived articles tagged "research"

列出标记为"research"的已归档文章

readwise reader-list-documents --location archive --tag research --category article
readwise reader-list-documents --location archive --tag research --category article

List unseen documents in the inbox

列出收件箱中未查看的文档

readwise reader-list-documents --location new --seen false
readwise reader-list-documents --location new --seen false

List RSS feed items

列出RSS订阅项目

readwise reader-list-documents --location feed --limit 20 --response-fields title,author,summary,site_name
readwise reader-list-documents --location feed --limit 20 --response-fields title,author,summary,site_name

Get a specific document by ID

通过ID获取特定文档

readwise reader-list-documents --id <document_id>

Locations: `new` (inbox), `later`, `shortlist`, `archive`, `feed`. When the user says "inbox", use `new`.
readwise reader-list-documents --id <document_id>

位置说明:`new`(收件箱)、`later`(稍后阅读)、`shortlist`(精选列表)、`archive`(归档)、`feed`(订阅源)。当用户提到“收件箱”时,使用`new`参数。

Reading and highlighting

阅读与高亮标记

bash
undefined
bash
undefined

Get full document content as Markdown

获取完整文档的Markdown格式内容

readwise reader-get-document-details --document-id <id>
readwise reader-get-document-details --document-id <id>

Get all highlights on a document

获取某篇文档的所有高亮内容

readwise reader-get-document-highlights --document-id <id>
readwise reader-get-document-highlights --document-id <id>

Highlight a passage (html-content must match the document's HTML exactly)

高亮指定段落(html-content必须与文档的HTML完全匹配)

Get the HTML first via reader-list-documents with --response-fields html_content

请先通过reader-list-documents命令并添加--response-fields html_content参数获取HTML内容

readwise reader-create-highlight --document-id <id> --html-content "<p>The exact passage to highlight</p>"
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
undefined
readwise reader-create-highlight --document-id <id> --html-content "<p>Key insight</p>" --note "Connects to spaced repetition research" --tags review,concept
undefined

Saving documents

保存文档

bash
undefined
bash
undefined

Save a URL — Reader scrapes it automatically

保存URL —— Reader会自动抓取内容

readwise reader-create-document --url "https://example.com/article"
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"
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)

保存原始Markdown内容(需提供唯一URL作为标识符)

readwise reader-create-document --title "Meeting Notes" --markdown "# Notes from today..." --url "https://me.com#notes-march-2025"
undefined
readwise reader-create-document --title "Meeting Notes" --markdown "# Notes from today..." --url "https://me.com#notes-march-2025"
undefined

Organizing

整理文档

bash
undefined
bash
undefined

Move documents between locations (max 50 per call)

在不同位置之间移动文档(每次调用最多50个)

readwise reader-move-documents --document-ids <id1>,<id2> --location archive readwise reader-move-documents --document-ids <id> --location later
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}]'
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"]}]'
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
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"
undefined
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"
undefined

Exporting

导出文档

bash
undefined
bash
undefined

Export all documents as a ZIP of Markdown files (async)

将所有文档导出为Markdown文件的ZIP包(异步操作)

readwise reader-export-documents readwise reader-get-export-documents-status --export-id <id>
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"
undefined
readwise reader-export-documents --since-updated "2024-01-01T00:00:00Z"
undefined

Readwise Commands

Readwise 核心功能命令

Searching highlights

搜索高亮内容

bash
undefined
bash
undefined

Semantic search across all highlights

在所有高亮内容中进行语义搜索

readwise readwise-search-highlights --vector-search-term "learning techniques"
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"}]'

Full-text query fields: `document_author`, `document_title`, `highlight_note`, `highlight_plaintext`, `highlight_tags`.
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`。

Browsing highlights

浏览高亮内容

bash
undefined
bash
undefined

List 20 most recent highlights

列出20条最新的高亮内容

readwise readwise-list-highlights --page-size 20
readwise readwise-list-highlights --page-size 20

Highlights from a specific book

获取某本特定书籍的高亮内容

readwise readwise-list-highlights --book-id <id>
readwise readwise-list-highlights --book-id <id>

Highlights from the last month

获取最近一个月的高亮内容

readwise readwise-list-highlights --highlighted-at-gt "2025-02-01T00:00:00Z"
undefined
readwise readwise-list-highlights --highlighted-at-gt "2025-02-01T00:00:00Z"
undefined

Creating and editing highlights

创建与编辑高亮内容

bash
undefined
bash
undefined

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"}]'
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"}]'
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
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>

Colors: `yellow`, `blue`, `pink`, `orange`, `green`, `purple`.
readwise readwise-delete-highlight --highlight-id <id>

支持的颜色:`yellow`、`blue`、`pink`、`orange`、`green`、`purple`。

Daily review

每日复习

bash
undefined
bash
undefined

Get today's spaced repetition review

获取今日的间隔重复复习内容

readwise readwise-get-daily-review

Returns highlights selected by the spaced repetition algorithm plus a URL for interactive review.
readwise readwise-get-daily-review

返回由间隔重复算法筛选出的高亮内容,以及一个用于交互式复习的URL。

Example Workflows

示例工作流

Triage the inbox: List recent saves, read each one, decide what's worth the user's time.
bash
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
Search across everything: Find all content on a topic across both highlights and documents.
bash
readwise reader-search-documents --query "spaced repetition"
readwise readwise-search-highlights --vector-search-term "spaced repetition"
Quiz on a recent read: Find a finished document, get its content and highlights, quiz the user.
bash
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>
Catch up on RSS: Browse feed items, surface the best ones, mark the rest as seen.
bash
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
Save and annotate: Save a URL, highlight key passages, tag and organize.
bash
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
Build a reading recap: See what you've finished and highlighted recently.
bash
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
收件箱分类整理: 列出最近保存的内容,逐一阅读,判断是否值得投入时间。
bash
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  # 跳过
全局内容搜索: 在高亮内容和文档中查找所有与某主题相关的内容。
bash
readwise reader-search-documents --query "spaced repetition"
readwise readwise-search-highlights --vector-search-term "spaced repetition"
针对近期阅读内容进行自测: 找到已读完的文档,获取其内容和高亮内容,对用户进行测试。
bash
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订阅: 浏览订阅源内容,筛选优质内容,标记其余为已查看。
bash
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,高亮关键段落,添加标签并整理。
bash
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
生成阅读回顾: 查看近期已完成阅读和标记高亮的内容。
bash
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