mcpField
R
readwise-cli

readwise-cli

github.com/readwiseio生産性326596 回インストール19 週間前に更新
リポジトリ

readwise-cli について

readwise-cliは、ReadwiseのハイライトとReaderのドキュメントにアクセスするコマンドラインツールです。検索、閲覧、注釈、整理、エクスポートに対応し、機械処理向けのJSON出力も利用できます。

主な機能

  1. 01ドキュメントとハイライトの検索
  2. 02Readerドキュメントの閲覧と読み込み
  3. 03ドキュメントとハイライトの作成
  4. 04場所、タグ、メタデータの整理
  5. 05Markdown形式でのドキュメント出力

活用シーン

  1. 01特定のテーマの記事やハイライトの検索
  2. 02Readerの受信トレイの整理
  3. 03最近のハイライトの復習
  4. 04アーカイブ用ドキュメントの出力

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/readwiseio/readwise-skills --skill readwise-cli

インストール後、Claude Code で/readwise-cliを入力して読み込まれたか確認します。

詳細

Readwise CLI

readwise コマンドを使って、ユーザーの Readwise のハイライトや Reader のドキュメントにアクセスします。Readwise には 2 つの製品があります。

  • 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

コメント