Watch config
What freehand watch watches and what it does when something changes. One per person, at ~/.freehand/config.yml (or any file named with --config). Each repo keeps its own paper.yml.
Start from freehand init, which writes one for you. freehand watch --status shows what a config watches and what it has handled so far. The same schema, for your editor, is at /docs/schemas/config.json: add # yaml-language-server: $schema=https://freehand.sh/docs/schemas/config.json to the top of the file.
| Key | Type | Default | What it does |
|---|---|---|---|
drive |
text | — | Where your synced drive is on disk, for example ~/Library/CloudStorage/GoogleDrive-<account>/My Drive. Paths may start with ~/. Needed for repos, and for any folder written from the top of the drive. |
settings |
text | — | The settings.json the freehand script reads, as a path from the top of the drive. Optional: it says where proofs, copies and records go when a repo is sent from this computer. |
notebooks |
list of text | — | Folders of notebooks to read when pages sync. A folder on the drive may be written from the top of the drive (Supernote/Note) instead of in full. Only the folder’s own .note files count, not its subfolders. |
marks |
list of text | — | Folders of marked PDFs to read when marks sync, from the top of the drive or in full. Only the folder’s own .mark files count. |
repos |
list of text | — | Repos whose paper.yml says placed_by: local. A new commit sends whatever its paper.yml has due, straight into the device’s folders on disk. Needs drive. |
alive |
text | — | Your freehand inbox folder. While the watcher runs it keeps a small freehand-watcher.json there, and the freehand script leaves reading new pages to this computer. Optional. |
on |
group | — | What to do when something arrives. |
on.pages |
group | — | When new notebook pages have synced. |
on.pages.state |
text | ~/.freehand/pages |
The folder where every page is recorded: one small JSON file per notebook, with nothing about what the pages say. Safe to keep in your notes repo. |
on.pages.then |
text | — | A command to run after the pages are recorded and drawn, run by /bin/sh. FREEHAND_PAGES is the scratch folder of drawn pages waiting to be read (removed when the command ends), FREEHAND_CHANGED a JSON list of the notebooks that changed, and FREEHAND_TEXT the same in words. If it exits with anything but 0, the same pages are tried again after five minutes. |
on.marks |
group | — | When new marks have synced. |
on.marks.then |
text | — | A command to run after the marks are read, run by /bin/sh. FREEHAND_MARKS is the scratch folder with a picture of each marked page (removed when the command ends), FREEHAND_CHANGED a JSON list of the changed files, and FREEHAND_TEXT the same in words. If it exits with anything but 0, the same marks are tried again after five minutes. |
quiet_minutes |
number | 3 |
Wait this long after the newest change before reading, so a sync that is still uploading is never read half done. |
every_seconds |
number | 30 |
How often to look at the folders. Freehand polls instead of waiting for file events, which sync apps lose while a laptop sleeps. |
exclude |
list of text | — | File names never to read, such as a private notebook. Matched without regard to case. |
state |
text | ~/.freehand/watch.json |
Where this watcher remembers what it has handled. |
Paths may start with ~/. A folder under notebooks, marks or alive that is not absolute is read from the top of drive, so Supernote/Note means the Note folder on your drive. Keys not listed here are ignored.
What a config must have
Section titled “What a config must have”- At least one of
notebooks,marksorrepos, or there is nothing to watch. reposneedsdrive.- Every folder it names must exist. When anything is wrong,
freehand watchlists every problem at once.
Example
Section titled “Example”notebooks: - Supernote/Notemarks: - Supernote/Document/proofsrepos: - ~/noteson: pages: state: ~/notes/freehand/pages then: claude -p "read my new pages in $FREEHAND_PAGES"