How to extract your reMarkable highlights and send them to Anki? [AI prompts & github]
On Kindle, you can very easily export highlighted passages, but that’s not the case on reMarkable.
I used CODEX to create a local web interface where I can select my reMarkable files (epub/PDF), extract the highlights, and send them to Anki. Here’s the interface:

You can see that you can:
- export a document’s highlights into an ANKI deck
- group highlights from multiple files into an ANKI deck
- highlights that span multiple lines are grouped together and considered as a single highlight
Everything is exported directly to ANKI via Anki Connect. You just need the Anki app installed and open on Windows. Then, the decks will be synced with Ankiweb. For each card, you see the highlighted passage on the front, and on the back, its context (one sentence before, one sentence after).

If the same file has new highlights, the old ANKI cards won’t be deleted, only the new highlights will be added.
The GitHub repo is available here: https://github.com/tdm5c/remarkable-highlights-to-anki
If you don’t want to export highlights to ANKI, that’s possible too, you just need to ask CODEX to export them to an .html or .txt file or to Google Docs… (as you wish). I’ll give you some example prompts so you can have fun and create your own tool.
SSH Access
To get SSH access to your reMarkable, turn on your reMarkable, enable Wi-Fi, and go to HELP => Copyrights and licenses, read the instructions, plug the USB cable into your computer, authorize SSH access, and then retrieve the MAC address and the password.
For the reMarkable Paper Pro, you need to enable Developer Mode before doing all this. Developer Mode will reset the device but you won’t lose documents, you’ll just need to link the device to your reMarkable account to recover synced docs.
I’m sorry if I can’t be clearer, this article is a bit geek-oriented. More info
Prompt 1 – reMarkable to Anki Interface
Copy and paste the block below into your AI/development tool. The placeholders in brackets are there to show where these values will be configured locally.
You are a senior development agent. I want you to build a local web interface and a deterministic pipeline to export my reMarkable highlights to Anki. Local context to adapt ---------------------- - Working folder: [LOCAL PROJECT PATH HERE] - Desired local web interface: http://[LOCAL IP ADDRESS]:8787 - AnkiConnect URL: http://[ANKI CONNECT IP ADDRESS]:8765 - AnkiConnect add-on: 2055492159 - reMarkable SSH user: root - reMarkable SSH port: 22 - reMarkable MAC: keep in .env.local, not in the prompt - reMarkable SSH password: keep in .env.local, not in the prompt Security rules -------------- - Do not ask for real credentials in the prompt. - Never store the reMarkable password in source code, README, or Markdown notes. - Create a git-ignored .env.local file for local secrets. - Put real credentials only in .env.local, for example: RM_REMARKABLE_MAC=[MAC ADDRESS HERE] RM_SSH_PASSWORD=[SSH PASSWORD HERE] ANKI_CONNECT_URL=http://[ANKI CONNECT IP ADDRESS]:8765 - Never modify files on the reMarkable unless explicitly requested. - Use SSH only to read/copy data from the reMarkable. - Do not use OCR. - Do not use AI APIs or AI tokens to extract highlights. - Extraction must be local, deterministic, and rerunnable. Functional goals ---------------- Build a local tool that: 1. discovers the current IP address of the reMarkable from RM_REMARKABLE_MAC, since DHCP may change the IP; 2. lists available PDF/EPUB documents on the reMarkable; 3. copies necessary files locally; 4. extracts highlights; 5. creates or updates Anki cards via AnkiConnect; 6. syncs AnkiWeb after updates, unless disabled. Highlight extraction -------------------- - A continuous annotation spanning multiple lines or pages should become a single highlight. - If unhighlighted source text lies between two fragments, they are two distinct highlights. - Preserve document order: page order, then order of appearance on the page. - For PDF/EPUB, prefer the source document text when available; use .rm data as anchors. - For EPUBs copied from reMarkable, prefer the rendered PDF sidecar for alignment, as .rm pages correspond to that pagination. - The quote/front should never be extended to complete a word or sentence. - The back may contain context: exactly one preceding non-title sentence + sentence containing the highlight with the highlight bolded + exactly one following non-title sentence. Anki integration ---------------- - By default, create one Anki deck per reMarkable document, named exactly as the document. - Create one Anki card per highlight. - Front: exact quote/highlight. - Back: highlight in context when available. - Use stable IDs so reruns update existing notes and only add new highlights. - Delete obsolete Anki notes for the same document UUID when the stable set of highlights changes. - After local Anki sync, reposition only new cards in document appearance order. - Do not modify scheduling of already reviewed/learned cards. - If AnkiConnect is unreachable, start Anki Desktop automatically and wait for the collection to become available. - After local Anki update, run AnkiWeb sync automatically unless --no-sync-ankiweb. - For large documents, use batched AnkiConnect calls to avoid blocking. Local web interface ------------------- Build a simple and effective local web interface: - default view: the 10 most recent PDF/EPUB documents; - choices 10/20/30/all; - search only on Enter or click on the magnifier, not on every keystroke; - Refresh button that reruns detection/listing and SSH retries; - if the reMarkable is sleeping, show a clear message asking to wake the tablet then retry; - sorting: recent, name A-Z, name Z-A, PDF first, EPUB first; - multi-select documents; - "Select all" button; - selected documents must remain visible/pinned even if search or sorting would hide them; - multi-document export must follow the currently displayed order, not click order; - additional option "Single deck" only available if multiple files are selected; - if "Single deck" is enabled, send all selected highlights to a single Anki deck whose name is configurable; - otherwise keep one deck per document; - display export steps live; - display errors and log live in the interface without staying stuck on "running"; - on error, mark the current document as error and show an actionable message. Expected CLI ------------ Also provide a CLI: - --list to list documents; - --document to export a specific document; - --all to export all PDF/EPUB documents with highlights; - --no-anki to test without modifying Anki; - --no-sync-ankiweb to disable AnkiWeb sync; - --single-deck and --single-deck-name to export multiple documents into a single deck; - --host to force a reMarkable IP if needed; - --mac to force a MAC; - --no-discover to skip MAC-based detection. Deliverables ------------ - Complete source code. - README with installation and usage commands. - Project notes Markdown explaining decisions and limitations. - .gitignore that excludes .env.local, caches, temporary exports, and secrets. - Local web interface running on http://[LOCAL IP ADDRESS]:8787. - Minimal tests or checks showing: - extraction does not rely on OCR; - highlights remain in order; - reruns do not duplicate cards; - web errors are visible in the interface. Important constraints --------------------- - Never display my secrets in logs, README, or final responses. - If a secret is needed, use a placeholder or environment variable. - Keep the tool local, reproducible, and understandable. - Before finishing, check syntax, run available tests, then give exact commands to start the interface.
Prompt 2 – reMarkable extraction to TXT files
Copy-paste the block below into your AI/development tool. The placeholders in brackets show where these values will be configured locally.
You are a senior development agent. I want you to build a local web interface and a deterministic pipeline to extract my reMarkable highlights and save them to .txt files. I do not want an Anki export in this version.
Local context to adapt
------------------------
- Working directory: [LOCAL PROJECT PATH HERE]
- Desired local web interface: http://[LOCAL IP ADDRESS]:8787
- reMarkable SSH user: root
- reMarkable SSH port: 22
- reMarkable MAC: keep in .env.local, not in the prompt
- reMarkable SSH password: keep in .env.local, not in the prompt
Security rules
------------------
- Do not ask for real credentials in the prompt.
- Never store the reMarkable password in source code, README, or Markdown notes.
- Create a git-ignored .env.local file for local secrets.
- Put real credentials only in .env.local, for example:
RM_REMARKABLE_MAC=[MAC ADDRESS HERE]
RM_SSH_PASSWORD=[SSH PASSWORD HERE]
- Never modify files on the reMarkable unless explicitly requested.
- Use SSH only to read/copy data from the reMarkable.
- Do not use OCR.
- Do not use AI APIs or AI tokens to extract highlights.
- Extraction must be local, deterministic, and rerunnable.
- Never display my secrets in logs, README, or final answers.
Functional objective
--------------------
Build a local tool that:
1. discovers the current IP address of the reMarkable from RM_REMARKABLE_MAC, since DHCP can change the IP;
2. lists available PDF/EPUB documents on the reMarkable;
3. copies necessary files locally;
4. extracts highlights;
5. writes results to local .txt files.
Highlight extraction
-------------------------
- A continuous annotation spanning multiple lines or pages should become a single highlight.
- If non-highlighted source text sits between two fragments, those are two distinct highlights.
- Preserve document order: page order, then appearance order on the page.
- For PDF/EPUB, prefer the source document text when available; use .rm data as anchors.
- For EPUBs copied from reMarkable, prefer the rendered PDF sidecar for alignment, because .rm pages correspond to that pagination.
- The extracted quote must never be extended to complete a word or sentence.
- Do not infer text with AI. If alignment fails, flag it clearly in the log.
Output .txt format
-----------------------
Write one .txt file per document in a local folder, for example:
exports/remarkable_txt/[DOCUMENT_NAME].txt
Each file must contain:
- document title;
- document UUID if available;
- local export date;
- total number of highlights;
- list of highlights in document order.
Recommended format for each highlight:
---
Highlight 001
Page: [PAGE IF AVAILABLE]
Text:
[EXACT HIGHLIGHT TEXT]
---
Local web interface
--------------------
Build a simple and efficient local web interface:
- default display: the 10 most recent PDF/EPUB documents;
- choice 10/20/30/all;
- search only on Enter or click on the magnifying glass, not on every keystroke;
- Refresh button that relaunches detection/list and SSH retries;
- if the reMarkable is asleep, display a clear message asking to wake the tablet and then retry;
- sort: recent, name A-Z, name Z-A, PDF first, EPUB first;
- multi-selection of documents;
- "Select all" button;
- selected documents must remain visible/pinned even if a search or sort would hide them;
- multi-document export must follow the currently displayed order, not the order of clicks;
- "Export to TXT" button;
- display the path of the generated .txt files;
- display export steps in real time;
- display errors and log in real time in the interface, without getting stuck on "running";
- on error, mark the current document as error and display the actionable message.
Expected CLI
------------
Also provide a CLI:
- --list to list documents;
- --document to export a specific document;
- --all to export all PDF/EPUB documents with highlights;
- --output-dir to choose the .txt output folder;
- --host to force a reMarkable IP if necessary;
- --mac to force a MAC;
- --no-discover to skip MAC-based detection.
Expected deliverables
------------------
- Complete source code.
- README with installation and usage commands.
- Markdown project notes file explaining decisions and limitations.
- .gitignore that excludes .env.local, caches, temporary exports, and secrets.
- Local web interface launched on http://[LOCAL IP ADDRESS]:8787.
- Minimal checks or tests showing that:
- extraction does not rely on OCR;
- highlights remain in order;
- .txt files are recreatable without duplicates;
- web errors are visible in the interface.
Important constraints
-----------------------
- Never expose my secrets.
- If a secret is necessary, use a placeholder or an environment variable.
- Keep the tool local, reproducible, and understandable.
- Before finishing, verify syntax, run available tests, and provide exact commands to start the interface and export .txt files.