Repository navigation
Releases
v0.18.2
Fixes
An edit through zn never writes over a save another device just made. Against a self-hosted server, zn's edits read a note, change it and write it back. A save from another device landing in between used to be written over. With a server that supports conditional writes (ZenNotes server 2.91.0 or later), zn now names the version it read on every write, and the server refuses the write if the note changed:
- CLI and MCP edits (append, prepend, insert, replace, edit a section, toggle or update a task, and a database row's record page) read the note again and make the same change on the newer text. After three refusals they stop and say the note changed on the server, so nothing is lost.
- TUI saves (autosave and
:w) that race another device's save show the usual conflict: your buffer is kept and autosave holds off.:conflicthas a new Keep both (b): the server's version is kept as "Title (server copy)", then your edits are saved.
zn write and write_note still replace the note as asked. A local vault, and a server older than 2.91.0, behave exactly as before. Same protection as ZenNotes desktop 2.91.0 (ZenNotes/zennotes#1108).
How to test locally
- Run a ZenNotes server 2.91.0 and connect:
zn connect http://127.0.0.1:7878 --token <token>. - Open a note in
zn tui, change it on another device, then save in the TUI. Before: the other device's change was gone. After: the TUI shows a conflict;:conflictthenbkeeps both. zn append "inbox/Note.md" --body "from zn"while another device keeps saving the note: both changes end up in the file.
v0.18.1
Fixes
A note made again under a deleted note's name gets its own date on Windows. On NTFS, a file created under a name that was deleted in the last 15 seconds gets the deleted file's creation time back (file system tunneling). zn left a new note's date to that creation time, so deleting a note and making a new one with the same name showed the old note's date, and the first save wrote it down for good. A new note made with zn create, zn write, zn capture or zn mcp now records its own date in .zennotes/note-metadata/ the moment it is made. Notes created outside zn still fall back to the file's creation time. Same fix as ZenNotes desktop 2.90.0.
How to test locally
On Windows:
zn create --title "Tunnel test" --body "first"
zn delete "inbox/Tunnel test.md" --yes
zn create --title "Tunnel test" --body "second"
zn list --limit 1 --jsonBefore: createdAt is the first note's date. After: it is the moment of the second zn create.
v0.18.0
Features
Reach a server behind Cloudflare Access or another gateway. An access gateway in front of a self-hosted ZenNotes server turns away every request without its credentials. zn, zn tui and zn mcp now send them as extra headers on every request, live updates included, from ZENNOTES_REMOTE_HEADERS: one Name: value per line. For a Cloudflare Access service token:
export ZENNOTES_REMOTE_HEADERS=$'CF-Access-Client-Id: <client id>.access\nCF-Access-Client-Secret: <client secret>'
zn list --server https://notes.example.comIn an MCP client's JSON config, write the line break as \n inside the env value. Keep the server's own token in --token, ZENNOTES_REMOTE_TOKEN or zn connect. A value that does not parse stops the command with its line number before anything is sent, and a gateway that still refuses is named as one instead of showing its page. The headers are never written to credentials.toml. ZenNotes 2.89.0 takes the same lines in its connect dialog (ZenNotes/zennotes#1091, #54).
How to test locally
python3 - <<'PY' &
import http.server
class Gate(http.server.BaseHTTPRequestHandler):
def do_GET(self):
ok = self.headers.get('CF-Access-Client-Id') == 'id.access'
self.send_response(200 if ok else 403)
self.send_header('Content-Type', 'application/json' if ok else 'text/html')
self.end_headers()
self.wfile.write(b'null' if ok else b'<h1>denied</h1>')
http.server.HTTPServer(('127.0.0.1', 7980), Gate).serve_forever()
PY
zn vault info --server http://127.0.0.1:7980
ZENNOTES_REMOTE_HEADERS='CF-Access-Client-Id: id.access' zn vault info --server http://127.0.0.1:7980
kill %1- Before: both commands fail with an HTML error from the gateway.
- After: the first names the gateway and
ZENNOTES_REMOTE_HEADERS; the second gets past it.
v0.17.3
Fixes
A repeating task keeps its block id on the open task. A task that ends in a block id, like ^plants, so that [[Chores^plants]] can link to it, copied the id onto both lines when you ticked it off, and every roll added another line with the same id. The id now stays on the next occurrence, so links and embeds keep showing the task you do next, and the finished line drops it. A due: the roll adds goes in before the id, so a task with an id and no due date keeps it. Subtasks with ids follow the same rule. This matches ZenNotes 2.87.0 on the desktop and the phones, so a note rolls the same way wherever you tick it (ZenNotes/zennotes#1083, #53).
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox"
printf '# Chores\n\n- [ ] Water the plants @repeat:weekly due:2026-11-15 ^plants\n - [ ] Ferns ^ferns\n' > "$T/vault/inbox/Chores.md"
zn task list --vault "$T/vault"
zn task toggle <the id it printed for Water the plants> --vault "$T/vault"
cat "$T/vault/inbox/Chores.md"- Before: both
Water the plantslines end in^plants, and bothFernslines in^ferns. - After: only the new open lines keep
^plantsand^ferns; the[x]record and its[-]subtask have no ids.
v0.17.2
Fixes
Opening a task lands on the task. Enter on a task in Tasks opened its note with the cursor on the line above the task. It now sits on the task's own line. Thanks to @spirit-of-light for the fix (#51).
Opening a heading from the outline lands on the heading. Enter, l, o or a click on a heading in the outline panel put the cursor on the line above it. It now sits on the heading (#52).
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox"
printf '# Plan\n\nIntro\n\n## Errands\n\n- [ ] first\n- [ ] second\n\n## Later\n\nText\n' > "$T/vault/inbox/Plan.md"
zn tui --vault "$T/vault"- Press
Space x, move tosecondand press Enter. Before: the cursor sat on- [ ] first. After: it sits on- [ ] second. - Open
Plan, pressSpace p, move toLaterin the outline and press Enter. Before: the cursor sat on the blank line above. After: it sits on## Later.
v0.17.1
Fixes
The reading view does what it says. j, k, Ctrl+D, Ctrl+U, Ctrl+F, PgUp, PgDn and the wheel move the view on the first press, and the cursor still reaches every row, so Enter and x work everywhere. gd follows a link there too. With Vim off, keys no longer go to the hidden editor. Before: letters typed into your note.
Diagrams stay honest. A flowchart draws a row only for a straight run, and otherwise a column with other edges listed under their source, so boxes side by side never imply an arrow that isn't there. One-line flowcharts with a color draw again. Vec<i> in a label keeps its tag, and narrow panes keep edge styles.
Previews. A table under a list item keeps its blank row, and an image in running text keeps its brackets. In the zen style, spaced stars stay literal, *** is read whole, callout titles render as text, indented lines render as code, and an indented line under a quote continues the quote.
Names stay clean. Color codes in a note's or folder's name no longer reach your terminal from status lines, toasts, dialogs, menus, prompts, the sidebar, or zn mcp notices. Names themselves, including emoji and CJK, are unchanged.
Switching to the reading view with a command line open now cancels it without running it.
zn mcp:
- On a local vault, an assistant now sees database record pages, as it does on a server, and a deny entry on a page or database works rather than counting as stale.
- With a path limit, a record page can be read and edited, but not renamed, moved, copied, archived, trashed or deleted, and a database can't be listed, renamed or deleted as a folder. Full access is unchanged.
- An attachment name with surrounding spaces, like
" trash", is refused. - A limit naming a folder whose name has accents picks the exact spelling first.
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox"
{ printf '# Long\n\n'; for i in $(seq 1 200); do printf 'Line %s\n\n' "$i"; done; } > "$T/vault/inbox/Long.md"
printf '# Chart\n\n```mermaid\ngraph TD\nA[One]-->B[Two]; style A fill:#f9f; B-->C[Three]\nC-->A\n```\n' > "$T/vault/inbox/Chart.md"
zn tui --vault "$T/vault"- Open
Long, pressSpace z p, thenj. Before: nothing moved for 25 to 40 presses. After: the view moves on the first press. - Press Ctrl+F. It pages.
- Open
Chart, then preview it. It draws, and the edge back toOneis listed rather than implied. - With Vim off in Settings, press
jin the reading view. Before:jwas typed into the note. After: the note is unchanged.
Known limits
- With a path limit, a new or moved file can take a number when a hidden file has its name.
- A scoped client can still delete or rename a parent folder that holds a database, if no deny entry sits inside it.
- Ctrl+B stays the sidebar toggle, so it doesn't page.
- A wide character in a one-cell pane overflows.
v0.17.0
Security
Please update. This release hardens path limits (--allow-path, --deny-path) and stops a note's control sequences from reaching your terminal. Details follow in an advisory. Path limits on a server need server 2.82.1 or newer.
What's new
mcpserver: zn mcp can be hosted over HTTP (znserver#56). The new package is what server 2.83.0's built-in /mcp endpoint runs on, so a hosted client gets the same tools and the same limits as zn mcp.
Mermaid diagrams draw at any pane width (#39, #41). Flowcharts show every node and edge, and sequence, class and ER diagrams lose nothing. When a diagram can't be drawn faithfully, you see its source with a note instead of a wrong picture.
Fixes
- A note's control sequences stay out of your terminal (#44), in the TUI and in commands like
zn search,zn listandzn readon a terminal. Piped output is unchanged. A note can no longer hide text with color codes in Tasks, Kanban, comments, the outline or Home. - Opening a note with an invalid byte no longer changes it (#44). Before: the tab was marked changed on opening, and
:qarewrote the byte on disk. - Code stays literal in the preview (#40, #43).
[[links]]and![[embeds]]in code show as written.xtoggles the right task when a list holds a code block, and indented list content keeps its links, embeds and math. - A table's escaped link is a link (#42, #45).
[[Note\|alias]]opens the note, counts in backlinks, and keeps its escape throughzn rename, so the table row stays whole. zn mcp's attachment and task tools are stricter and safer (#46):- Parallel writes take turns, so they can't overwrite a file or lose an edit.
rename_assetrefuses names that would break links, and names any note it couldn't update inlinksNotUpdated.- Finishing a recurring task with
update_taskwrites the next one, astoggle_taskdoes. - Task ids can be checked with
expectedText.
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox/Foo" "$T/vault/archive/Foo" "$T/vault/assets"
printf '# Note\n' > "$T/vault/inbox/Note.md"
printf '# Plan\n\n| Link | x |\n|---|---|\n| [[Note\\|alias]] | y |\n\n```mermaid\ngraph LR\n A[One long label] --> B[Another long label] --> C[End]\n```\n\n- [ ] first\n\n ```\n [x] not a task\n ```\n- [ ] second\n' > "$T/vault/inbox/Plan.md"
printf '# Kept\n' > "$T/vault/inbox/Foo/x.md"
printf '# Also kept\n' > "$T/vault/archive/Foo/x.md"
zn tui --vault "$T/vault"- Open
Plan, then the preview at any pane width. The diagram shows every box and arrow, and the table's link showsalias. - On
second, pressx. It checkssecond, not the line in the code block. - Run
zn rename inbox/Note.md --to Renamed --vault "$T/vault". The link inPlanbecomes[[Renamed\|alias]], and the table stays whole. - Connect an MCP client with
zn mcp --vault "$T/vault" --deny-path inbox/Foo/x.md:read_noteonarchive/Foo/x.mdanswers "Note not found", anddelete_folderonarchive/Foois refused.
Known limits
- With a path limit, a new or moved file can take a number when a hidden file has its name.
- Some status lines echo a name's colors on a terminal.
- A table directly after a list item loses its blank row in the default preview style.
v0.16.0
Security
Please update. This release hardens path limits (--allow-path, --deny-path) against symbolic links on a server vault. Details follow in an advisory.
Update your server first. With a path limit, this zn asks the server to mark links, and refuses with a clear message on a server that cannot: any server older than 2.82.1. The reason also shows in vault_info. Access-only limits such as --read-only, and clients with no limits, keep working on any server.
What's new
zn mcp can manage attachments and more (#34, #35). 11 new tools, 45 in all. Thank you, Asterythm.
read_asset: returns an image, text or an embedded file, up to 5 MiB.upload_asset: adds a file from base64, up to 16 MiB, never overwriting, and returns the embed to paste into a note.rename_asset,move_asset: also update the notes that link to the file.duplicate_asset,delete_asset,restore_asset: deleting is soft, with an undo token.list_assets {deleted: true}lists what can be restored.update_task: changes a task's due date, priority,@waiting, state, status or text.daily_note: finds the note under the vault's own settings without changing anything.note_sections,edit_section: list a note's headings, read the part under one, or append, prepend or replace it.
Purging deleted files is left out on purpose: it cannot be undone. With a path limit on a server, renaming, moving, reading and duplicating attachments are refused.
Fixes
- A server switching its own vault no longer redirects
zn mcpsilently (#37). Calls stop untilvault_inforeports the new vault, so nothing lands in the wrong one. - Renaming a file in the TUI updates bare embeds and counts them as uses (#36). On a server older than 2.50.4 the rename still works, but embeds are not rewritten.
- A renamed file that gains a space keeps its plain Markdown links working on a local vault.
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox/Projects" "$T/vault/inbox/Private" "$T/vault/assets"
printf '# Plan\n\n![[photo.png]]\n' > "$T/vault/inbox/Projects/Plan.md"
printf '# Secret\n' > "$T/vault/inbox/Private/Secret.md"
printf 'x' > "$T/vault/assets/photo.png"
zn tui --vault "$T/vault"- In the Files view, rename
photo.png. Before:Plan.mdkept the old name. After: its embed follows the new name. - Connect an MCP client with
zn mcp --vault "$T/vault"and list tools: 45. - Connect with
zn mcp --vault "$T/vault" --allow-path inbox/Projects:list_notesshows onlyPlan,note_sectionsreads it, andread_noteoninbox/Private/Secret.mdanswers "Note not found".
v0.15.0
What's new
Undo can no longer wipe a note (#32). A note opened by a key press started as an empty editor, and its text arrived as an undoable change, so pressing u right after opening went back to empty and autosave then wrote that over the file. If this happened to you, check the note's history or your backups.
- Undo now stops at the note as you opened it.
- If undo or redo leaves a note blank while its file has text, autosave, closing a tab and quitting no longer write it.
:w,Ctrl+Sand:wqstill can, andggdGis an edit that saves as ever.
Autosave can be turned off (#32). Set [terminal] autosave = false, run zn config set terminal.autosave false, or use the terminal.autosave row in :settings. The default stays on.
:w,Ctrl+S,:wq,:waand:wqasave.:q,:qa,Ctrl+C, closing the last tab showing the note and switching vault refuse while there are unsaved edits.:q!and:qa!discard them.- Any other exit, such as the terminal closing, sends your edits to a recovery copy, not the note.
- Rename, move, trash, task toggle and
$EDITORstill save first, because they act on the file.
gd follows links the way the desktop does (#32, #33).
- A relative link with no
.md, such as[March 31](./Daily/2020-03-31), opens the note instead of saying "Not a note". A path relative to the current note now beats the same path from the vault root. - Destinations with spaces work, with or without angle brackets:
[a](<./My Note>). - A dead relative link asks
Create note "Work/My Note"?and creates the note where the link points. #heading,^blockand#^blockland on their target, on Markdown links and wikilinks, in the editor and in reading mode.[a](#Heading),[[#Heading]]and[[^id]]jump inside the note.- A bare domain such as
[site](google.com)openshttps://google.com.Note.mdandphoto.pngstay local.
Still different from the desktop: vault attachments and files outside the vault from a Markdown link, gating of application schemes, periodic notes from a dead link, [[https://...]], and .base databases.
Fixes
- The README no longer warns that the desktop app drops
[terminal]. Desktop 2.81.0 and later keep it, soautosave = falsesurvives; on an older desktop it is lost when the app savesconfig.toml.
How to test locally
T=$(mktemp -d); mkdir -p "$T/vault/inbox/Daily" "$T/config"
printf '# Keep me\n\nPrecious content line.\n' > "$T/vault/inbox/Keep.md"
printf '# Index\n\n[March 31](./Daily/2020-03-31)\n' > "$T/vault/inbox/Index.md"
printf '# March 31\n' > "$T/vault/inbox/Daily/2020-03-31.md"
ZENNOTES_CONFIG_DIR="$T/config" zn tui --vault "$T/vault"- Open Keep and press
u:Already at oldest change, and the file is intact. Before: the note went empty, and autosave wrote that to disk. - Open Index, move to the link and press
gd: the March 31 note opens. Before: "Not a note". - Add
[terminal]andautosave = falseto$T/config/config.toml, relaunch and edit a note: the text is not on disk until:w, and:qrefuses.
v0.14.0
What's new
Tasks calendar: month, week and day views (#30, thanks spirit-of-light). :tasks calendar opens a full-page month that lists each day's tasks above a No date strip.
Escswitches to a week or a single day.Tabmoves between the grid, the day's tasks and the strip.Tmoves a task to today and@picks its due date, as on the desktop.[and]change the month at once, and the mouse works throughout.- A narrow terminal gets a compact month instead of "Terminal too small".
- With Vim mode off, letters never act on a task there.
- Week and day columns list a day's tasks from the top without an hour axis, since tasks have dates, not times.
A bar cursor while you type (#29, thanks spirit-of-light). The editor drew a reverse-video block in every mode, so insert mode looked like normal mode and the block hid the character under it.
- zn now shows the terminal's own cursor while text is being typed: a steady bar in insert mode and with Vim mode off, and an underline in replace mode and while
rwaits for its character. - Normal and visual mode keep the block.
- The bar follows the command line, the palette, pickers, prompts and database cells too.
- The terminal's default cursor comes back on quit, Ctrl+Z, the external editor and opening the config. A terminal that doesn't support cursor shapes shows its usual cursor.
A note can choose how it opens (#28, thanks spirit-of-light). Two settings under [terminal] let a note pick edit, preview or split from its own frontmatter. Both are off by default, so nothing changes unless you set them.
view_mode_field = "view-mode"makes a note withview-mode: previewopen in preview.[terminal.view_mode_rules]maps a field and value to a mode, as in"page-status=done" = "preview", so a finished page opens ready to read.:settingslists the field and the rules and adds or removes them, andzn configgets and sets them.- The ZenNotes desktop app doesn't know these keys and leaves them out when it saves
config.toml; the README says so.
New notes open in the editor (#26, thanks spirit-of-light). With the default view mode set to preview or split, a new note opened read-only while you typed into it. Every way of making a note now opens it in the editor, as the desktop app does: :new, Search notes, a quick note, a link to a missing note, a daily, weekly or monthly note made on first open, a note from a template, :taskfile and :rollover. The default view mode and each note's remembered mode stay as they were.
[b and ]b from anywhere (#27, thanks spirit-of-light). In Vim mode, [b / ]b and gt / gT switch tabs from Home, Tasks, the calendars, databases and the side panels, not only from a note.
- The calendars keep
[and]for the month, and the Kanban board keepsg. - A held first key shows in the status bar.
- With Vim mode off none of these keys act.
Settings grouped by where they save (#22, thanks spirit-of-light). The settings page lists its rows under "User · config.toml" and "Vault · .zennotes/vault.json", so you can see where each change lands. It scrolls cleanly on a taller window and keeps each row's whole text.
Changelog
- 71bd186 Feat(cli): zn config lists, reads and sets terminal view-mode rules
- 4bbbc0b Feat(config): a terminal view-mode field and frontmatter rules table
- 84b3379 Feat(tui): Esc switches the Tasks calendar between month, week and day
- 5a224ff Feat(tui): T opens a due-date menu from the calendar's task lists
- 1622851 Feat(tui): Tab reaches the calendar's No-date strip
- 986d91b Feat(tui): a bar in text fields and quick capture
- 0c97bab Feat(tui): a bar on the command line
- 7f3e269 Feat(tui): a bar or underline cursor for the note being edited
- 5271c09 Feat(tui): a newly created note opens in the editor, whatever its frontmatter
- c1de97e Feat(tui): a note opens in the view mode its frontmatter asks for
- e234a94 Feat(tui): a terminal output wrapper that places and shapes the cursor
- 49237b9 Feat(tui): an underline while r waits for its character
- f86670d Feat(tui): half-hourly hour list and hour-list scrolling in week and day
- d2642ba Feat(tui): half-page keys page the Tasks calendar by month
- 85815a9 Feat(tui): menus, toasts and sidebar focus hide the cursor
- a39a2cc Feat(tui): mouse on calendar entries and the No-date strip
- 6500bb1 Feat(tui): place calendar tasks by due and scheduled date
- 9077380 Feat(tui): reset the cursor shape around suspend and external programs
- 47370e5 Feat(tui): scroll a busy day's column in week and day view
- b7bda03 Feat(tui): settings group headings name the file each group saves to
- bea0218 Feat(tui): settings page groups rows under User and Vault by prefix
- 1cb85fb Feat(tui): split copies, restored tabs and references respect view modes
- 9f47fd8 Feat(tui): the Tasks calendar opens on a full-page month grid
- 481b47b Feat(tui): the cursor finds its cell in every pane layout
- 7428c7d Feat(tui): view-mode settings and rules on the settings page
- fd41049 Feat(tui): week and day calendar navigation and column focus
- cb78af2 Feat(tui): work out a note's view mode from its frontmatter
- b437c10 Feat(tui): zn shows the terminal cursor and resets its shape on exit
- 3fe9eae Feat(vim): the editor reports when r waits for its character
- 2e2da5f Fix(config): a view-mode rule with an empty value is invalid
- 8afc2ad Fix(config): rules differing only in case, or with a non-string mode
- e728db0 Fix(tui): Ctrl+Z on Windows leaves the cursor alone
- 557e86a Fix(tui): T moves a calendar task to today, and @ opens the due-date menu
- 041da14 Fix(tui):
[band]bswitch tabs from every view and panel - 32a7f85 Fix(tui): a focused calendar task takes no letters with Vim off
- 0381c69 Fix(tui): a new note opens in the editor whatever the default pane mode
- ce02956 Fix(tui): a sidebar peek stays in preview and a reopened tab follows frontmatter
- a56296c Fix(tui): a toast hides the cursor only where it is drawn over it
- f0d6fd1 Fix(tui): calendar overflow count no longer cut mid-word
- d3401ca Fix(tui): every new note opens in the editor, not only a blank one
- fecb57b Fix(tui): every new note opens in the editor, with frontmatter view modes off too
- a5063d6 Fix(tui): grouped settings scroll back on a taller window and keep each row's whole text
- 7d9cc36 Fix(tui): keep the terminal cursor inside the editor and on screen
- abe7899 Fix(tui): reopening a closed tab whose note is gone leaves the active tab alone
- 0c118b4 Fix(tui): right-click lands on the clicked cell in framed panes
- 591d660 Fix(tui): the Tasks calendar keeps a compact month on narrow terminals
- fc819fc Fix(tui): the calendar's key hints follow its focus and view
- 730f394 Fix(tui): the calendars keep
[and], and the Kanban board keepsg - 2dbedd7 Fix(tui): the external editor writes to the terminal, not to a pipe
- 87a7838 Fix(tui): the field cursor sits on the field under a wrapping title
- 97a823c Fix(tui): the status bar shows a held
[,]org - 015a97e Fix(tui): zn tui reads the terminal when stdin is redirected
- 44eec1c Merge #22: settings page groups rows under User and Vault by prefix (by @spirit-of-light)
- a6d5a2a Merge #26: a new note opens in the editor always, despite the set default mode (by @spirit-of-light)
- 83017f2 Merge #27:
[band]bswitch tabs from every view and panel (by @spirit-of-light) - 200d9b3 Merge #28: frontmatter default mode definition (by @spirit-of-light)
- b16a187 Merge #29: a bar cursor in insert mode, an underline in replace mode (by @spirit-of-light)
- 072a386 Merge #30: month, week and day views for the Tasks calendar (by @spirit-of-light)
- 020afdc Refactor(tui): a new note reaches the editor one way, not two
- 038ea1f...