通过命令行访问您的Readwise高亮和Reader文档,搜索、阅读、整理并管理您的整个阅读库。
读取 CLI是一项面向实际任务的技能,主要用于使用读取命令访问用户的 Readwise 高亮和 Reader 文档;读取有两种产品: 读取 : 从书籍、文章、播客等处获取高亮。
从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
使用 readwise 命令访问用户的 Readwise 高亮内容和 Reader 文档。Readwise 提供两款产品:
若尚未安装 readwise CLI:
npm install -g @readwise/cli
若尚未完成身份验证,请向用户索取其 Readwise 访问令牌(可在 https://readwise.io/access_token 获取),然后执行:
readwise login-with-token
所有命令均支持 --help 参数以查看完整选项说明:
readwise --help readwise reader-search-documents --help readwise readwise-list-highlights --help
在任意命令后添加 --json 可获得机器可读格式输出;使用 --refresh 可强制刷新缓存数据。
# 在全部已保存文档中进行语义搜索 readwise reader-search-documents --query "spaced repetition" # 带筛选条件的搜索 —— 按类别、位置、作者、日期范围、标签等 readwise reader-search-documents --query "machine learning" --category-in article --location-in later,shortlist # 列出最近的收件箱条目(仅返回最小字段集,节省 token) readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category # 列出归档中带有特定标签的文章 readwise reader-list-documents --location archive --tag "research" --category article # 列出未读文档 readwise reader-list-documents --location new --seen false
Reader 的位置类型包括:new(收件箱)、later、shortlist、archive、feed。当用户提及“inbox”时,请使用 new。
# 获取文档完整详情(含 Markdown 内容) readwise reader-get-document-details --document-id# 获取某文档下的全部高亮 readwise reader-get-document-highlights --document-id
# 保存一个 URL —— Reader 将自动抓取页面内容 readwise reader-create-document --url "https://example.com/article" # 带元数据与标签保存 readwise reader-create-document --url "https://example.com" --title "My Title" --tags research,important # 保存原始内容(需提供唯一 URL 作为标识符) readwise reader-create-document --title "Meeting Notes" --markdown "# Notes from today..." --url "https://me.com#notes-2024" # 高亮某段文字(html-content 必须与文档原始 HTML 完全一致) readwise reader-create-highlight --document-id--html-content " The key passage
" --note "Connects to..."
# 在不同位置间移动文档(单次最多 50 个) readwise reader-move-documents --document-ids, --location archive # 批量标记为已读 readwise reader-bulk-edit-document-metadata --documents '[{"document_id": " ", "seen": true}]' # 标签管理 readwise reader-list-tags readwise reader-add-tags-to-document --document-id --tag-names important,research readwise reader-remove-tags-from-document --document-id --tag-names old-tag # 高亮标签与备注 readwise reader-add-tags-to-highlight --document-id --highlight-document-id --tag-names concept readwise reader-set-highlight-notes --document-id --highlight-document-id --notes "My note"
# 将全部文档导出为 Markdown ZIP 包(异步操作 —— 需轮询获取完成状态) readwise reader-export-documents readwise reader-get-export-documents-status --export-id# 增量导出 —— 仅导出自上次导出以来更新过的文档 readwise reader-export-documents --since-updated "2024-01-01T00:00:00Z"
# 在全部高亮(图书、文章、播客等)中进行语义搜索 readwise readwise-search-highlights --vector-search-term "learning techniques" # 列出最近的高亮 readwise readwise-list-highlights --page-size 20 # 某本特定图书中的高亮 readwise readwise-list-highlights --book-id# 过去一个月内的高亮 readwise readwise-list-highlights --highlighted-at-gt "2024-06-01T00:00:00Z"
# 创建高亮(将匹配标题/作者归属至对应图书;若无标题则归入 “Quotes” 分类)
readwise readwise-create-highlights --highlights '[{"text": "The key insight", "title": "Book Title", "author": "Author Name"}]'
# 更新高亮 —— 修改文本、添加备注、管理标签、设置颜色
readwise readwise-update-highlight --highlight-id --note "Updated note" --add-tags concept,review --color blue
# 删除高亮
readwise readwise-delete-highlight --highlight-id
# 获取今日间隔重复复习内容(含高亮及交互式复习页面 URL) readwise readwise-get-daily-review
收件箱分类处理:列出最近保存的文档,逐一阅读,判断是否值得用户投入时间,并将其移至合适位置。
readwise reader-list-documents --location new --limit 10 --response-fields title,author,summary,word_count,category,saved_at readwise reader-get-document-details --document-idreadwise reader-move-documents --document-ids --location later
全局主题搜索:并行搜索 Reader 文档与 Readwise 高亮,全面检索某一主题相关内容。
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-idreadwise reader-get-document-highlights --document-id
RSS 内容跟进:浏览近期 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": "", "seen": true}]'
readwise reader-move-documents --document-ids --location later
保存与批注:保存一个 URL,高亮关键段落,并用标签进行组织。
readwise reader-create-document --url "https://example.com/article" --tags research readwise reader-create-highlight --document-id--html-content " Key passage
" --note "This connects to..." readwise reader-add-tags-to-document --document-id--tag-names important,research
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习