Skip to content
jenssePublic

About

Synk a ReMarkable sketch between computer and tablet.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

README

The motivation for building this is a need for visual-thinking and communication with agents. I prefer drawing on paper, and this is the closest i get to sharing a whiteboard among multiple personas an myself. It is not real-time yet but we will get there.

syncbook -- notes for README.md

Raw steps and data collected while building this, kept here so nothing gets forgotten while the real README.md gets written by hand. Not meant to be the final doc -- reorganize/rewrite freely.


Pull reMarkable tablet notebooks over SSH and render them to PNG/SVG; push a modified page back, safely (backup first, hash-verify after).

No reMarkable cloud account, no desktop app, no USB required if your tablet is reachable over Wi-Fi/LAN -- just SSH.

Why

The reMarkable stores each notebook as a directory of pages in a reverse-engineered binary format ("lines v6"). syncbook doesn't reimplement that format itself -- it shells out to the real ssh/scp for transport (so it inherits your normal host-key handling and ssh-agent, nothing reimplemented) and to rmc / cairosvg via uv for rendering. syncbook itself is just the orchestration: find the notebook, move the right files, verify they arrived intact.

Prerequisites

  • A reMarkable tablet with SSH enabled (see below).
  • uv installed (curl -LsSf https://astral.sh/uv/install.sh | sh) -- used to run rmc/cairosvg without any manual pip install step.
  • Rust (to build syncbook itself): cargo build --release.
  • For pullrm --overlay/--notes on PDF documents: poppler's pdftoppm and pdftotext (apt install poppler-utils, brew install poppler).

Enabling SSH on the reMarkable

  1. On the tablet: Settings -> About -> General/Software, tap the entry near the bottom that shows a serial number and a one-time root password.This also shows the tablet's IP address on your current network (or use 10.11.99.1, the fixed address reMarkable always assigns itself over USB).

  2. From your computer, do one interactive login with that password while on USB to confirm connectivity:

ssh root@10.11.99.1
  1. Install your public key so you never need the one-time password again:
cat ~/.ssh/id_ed25519.pub | ssh root@<tablet-ip> \
 'mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys'

(Generate a key first if you don't have one: ssh-keygen -t ed25519.) Note the source file before the pipe and the chmods -- sshd will silently ignore authorized_keys if the permissions on ~/.ssh or the file itself are too open.

  1. Confirm the key-based login works before moving on:
ssh -o PreferredAuthentications=publickey root@<tablet-ip> echo ok

Building

cargo build --release
mkdir -p ~/bin
cp target/release/syncbook ~/bin/syncbook

Make sure ~/bin is on your PATH (add export PATH="$HOME/bin:$PATH" to your shell profile if it isn't already).

Releasing

Prebuilt binaries (Linux x86_64/aarch64 static musl, macOS arm64/x86_64) are built by .github/workflows/release.yml and attached to a GitHub Release when a v* tag is pushed. The tag must match the version in Cargo.toml, or the build stops at the first step:

# bump version = "X.Y.Z" in Cargo.toml, then:
cargo build            # updates Cargo.lock
git commit -am "Release X.Y.Z"
git tag vX.Y.Z
git push origin main vX.Y.Z

First run

syncbook doesn't keep its own config file -- both pullrm and pushrm connect via a normal ~/.ssh/config host alias (default name: remarkable), so plain ssh remarkable / scp remarkable:... on the command line behave identically to what syncbook does internally.

Run any command; if the alias isn't configured yet, you'll be prompted once:

$ syncbook pullrm "My Notebook"
No 'remarkable' entry found in ~/.ssh/config -- first-time setup for syncbook.
reMarkable hostname or IP: 10.11.99.1
Path to SSH private key [/home/you/.ssh/id_ed25519]:
Wrote Host 'remarkable' to ~/.ssh/config. Re-run your command to continue.

This appends a block like:

# BEGIN SYNCBOOK MANAGED (remarkable)
Host remarkable
    HostName 10.11.99.1
    User root
    IdentityFile /home/you/.ssh/id_ed25519
    StrictHostKeyChecking accept-new
# END SYNCBOOK MANAGED (remarkable)

Edit that block directly (e.g. to change the IP after switching from USB to Wi-Fi) -- syncbook only writes it once, on first run.

If you already have a working SSH alias for your tablet under a different name, just pass --host <name> instead of renaming anything:

syncbook --host my-existing-alias pullrm "My Notebook"

Usage

Pull a notebook by its visible name (as shown in the reMarkable UI) or by UUID:

syncbook pullrm "My Notebook"
# -> ./My_Notebook/<page-uuid>.rm, .svg, .png for each page, plus content.json

Read the handwritten notes on a document, each over the page it was written on (see Working with an agent on paper):

syncbook pullrm "My Sketch" --notes

Put a PDF on the tablet; a name that exists gets a new iteration in a folder of the same name, never a replaced document:

syncbook pushpdf sketch.pdf --name "My Sketch" --restart

Push a modified page back (backs up the current on-device state first, verifies the upload by hash afterward):

syncbook pushrm "My Notebook" <page-uuid> ./modified-page.rm

Important: the reMarkable's own app (xochitl) only re-parses a page from disk when its notebook is opened -- there is no live-reload signal to send. After pushrm succeeds, open (or close and reopen) the notebook on the tablet to see the change. Don't restart xochitl itself (systemctl restart xochitl) to "force" a refresh -- during development of this tool that caused a spurious blank page to appear, most likely because the currently-open document's in-memory state and the file on disk briefly disagreed across the restart. Simply opening the notebook is both safer and sufficient.

Working with an agent on paper

The loop: an agent (or a colleague) puts a page on the tablet, you think on it with the pen, and the agent reads back what you wrote, and where.

 agent                      tablet                      agent
 pushpdf draft.pdf  --->  you write on the page  --->  pullrm --notes
     ^                                                     |
     +------------- next iteration, same name <------------+

1. Put a page on the tablet

syncbook pushpdf examples/sample-page.pdf --name "syncbook sample" --restart

The first push of a name creates the document. Every later push of the same name is a new iteration: it goes into a folder with the same name, next to the document, as syncbook sample 2026-11-28 12:40. The document you wrote on is never replaced, the library does not fill up with near-copies, and every iteration is kept:

My Documents
  syncbook sample                 <- the first version, with your ink
  syncbook sample/                <- folder: one entry per later iteration
    syncbook sample 2026-11-28 12:40
    syncbook sample 2026-11-29 09:15

--restart restarts the tablet's app (xochitl) so the document shows at once; that closes whatever is open on the tablet. Without it the document shows after the next restart. If two documents already carry the name, pushpdf stops and says so, rather than guess which one is meant.

2. Write on it

The sample page (examples/sample-page.pdf, made from sample-page.html): some lipsum and a figure to point at.

The sample page: lipsum and a three-box figure

What makes notes easy to read back:

  • Write next to what you mean, or draw an arrow to it. The page under your ink is kept, so position is meaning.
  • Leave space between notes. Strokes closer than about one line of your writing count as one note; a clear gap starts a new one.
  • Zoom out and write in the margin or outside the page as much as you like: the whole canvas is read, not only the page.
  • For exact words (a name, a number, a term), use the keyboard text tool: typed text comes back as text, with nothing to recognise.

3. Read it back

syncbook pullrm "syncbook sample" --notes

Next to the usual page renders this writes:

File What it is
page-NN-overlay.png the whole canvas: your ink thin and red over the page it was written on
page-NN-note-MM.png one image per note, with the page around it
notes.md for people: each note's image, the page text nearest to it, and whether it is outside the page
notes.json the same for programs, plus each note's box, stroke count and any typed text

--overlay writes only the overview images.

Why it is drawn this way: the pen stores pressure as width, which drowns letters written small or zoomed out, and ink without its page loses what each note is about. Thin red ink over the page fixes both.

For an agent reading the notes, this is also the cheap way. Read notes.md first; the "near" line often says what a note is about without looking at it. Then look at one small note image at a time, not at the whole page: a handful of small images costs a fraction of one large one, and is easier to read.

A real round trip

This was done for real on 2026-11-28, with the files in examples/.

1. Before. syncbook pushpdf examples/demo.pdf --name "syncbook demo" --restart put two pages on the tablet: two jokes to choose between, and a wireframe of a front page with a large image.

Before: two jokes, and a wireframe with a large image

2. Notes. On the tablet the owner wrote "We use this one" with a line into joke A. On page 2: "This image is too big" with an arrow to the image, and "make it this big (and wrap the text around)" with an arrow to a smaller frame drawn over it, and the text sketched around that frame. syncbook pullrm "syncbook demo" --notes gave back:

Notes: the ink in red over each page

and this notes.md (images left out):

## Page 1
- Note 1: near "It wanted to work on its handwriting in"
## Page 2
- Note 1: near "Image"

3. What the agent read. The tool finds the notes and what they sit next to; reading the words and the shapes is the agent's part, from one note image at a time:

Page Ink Read as
1 "We use this one", line into joke A use joke A, drop joke B
2 "This image is too big", arrow to the image the image is to shrink
2 "make it this big (and wrap the text around)", arrow to a drawn frame the image becomes the frame: about 52 % of the width and 50 % of the height, top left; text to its right, continuing below

The frame's size is measured from the note's box against the image on the page, not guessed. On page 2 the frame, the text and both arrows touch, so they come out as one note; "near" is still right ("Image").

Note 1 on page 1, as the agent sees it

4. After. The agent changed the page (examples/demo-v2.html) and pushed it with the same name, so it went into the folder "syncbook demo" as "syncbook demo 2026-11-28 12:28". The page with the ink stayed as it was.

After: joke A only, and the image half the size with text around it

The next round would start the same way: write on the new iteration, pull, change, push.

Limits

  • "Near" is the nearest line of page text, not what an arrow points at. A note outside the page with an arrow into it gets the text closest to the note. Following arrows is the next step.
  • rmc warns that the current tablet firmware writes data it does not fully read ("newer format than this reader supports"). Strokes have come through complete so far, but a stroke type it cannot read would be missing.
  • Notes are found by distance alone. Two notes written very close together come out as one; a note with wide gaps inside can come out as two.

Backups

Every pushrm backs up the notebook's current .metadata, .content, and the target page's current .rm (if it exists) to ~/remarkable-backups/<UTC-timestamp>/<notebook-uuid>/ before touching anything on the device. Nothing is deleted automatically -- prune old backups by hand whenever you like.

Advanced: writing native ink annotations

pushrm will happily upload any valid .rm file, but constructing one that adds new pen strokes to an existing page -- e.g. to draw a native ink annotation on top of someone's sketch -- is real surgery on a reverse-engineered CRDT format, not something this tool automates. It's documented as a worked example instead of a polished subcommand, because getting it right requires understanding two non-obvious things:

  1. New content should go on its own layer, with its own freshly registered author ID -- see examples/annotate.py, which uses rmscene to build a Group, register it under the page's root, and add a Line to it.
  2. A new CRDT sequence item must not fabricate a causal link to existing content. The natural-seeming approach -- pointing your new layer's left_id at an existing item's ID, to insert it "after" that item -- gets silently accepted by rmscene's reader (which is lenient) but rejected by the real reMarkable app with rm.crdt.item Item: invalid origin left: ... / rm.crdt.sequence - invalid item in journalctl -u xochitl, because you never actually observed that item's insertion the way a real collaborating client would have. The correct, honest representation of an independently-added layer is left_id = right_id = CrdtId(0, 0) -- a concurrent, uncoordinated insert, which is exactly what real independent edits are. Using a fabricated reference caused this exact failure during development, and the app's defensive recovery from it produced a stray blank page in the notebook as a side effect.

Run it like:

python3 examples/annotate.py path/to/page.rm path/to/page-annotated.rm
syncbook pushrm "My Notebook" <page-uuid> path/to/page-annotated.rm

You'll need to adjust the circle's center/radius in the script to match where you actually want to annotate -- it's a worked example, not a general tool (finding a good general-purpose UI for "here's where to annotate" is future work, tracked as a shape/coordinate input problem, not a syncbook problem).

License

MIT, see LICENSE.

About

Synk a ReMarkable sketch between computer and tablet.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages