plannotator-tui 0.11.4

Annotate Markdown in the terminal - standalone, and as a Herdr plugin.
# plannotator-tui

Annotate Markdown in the terminal: select text, comment, ๐Ÿ‘ looks good, โœ— delete.

```bash
cargo build --release
./target/release/plannotator-tui samples/plugins.md     # one file
./target/release/plannotator-tui samples                # a folder: tree on the left
```

## Keys

| Where | Keys |
|---|---|
| anywhere | `Tab` cycle focus (tree ยท document ยท rail) ยท `z` hide/show the notes rail ยท `E` send feedback (clipboard) ยท `t` show/hide tree ยท `r` reload ยท `q` quit |
| document | drag with the mouse, or `v` then `hjkl` / `w` `b` `e` / `0` `$` to select; `a`, `c` or `d` acts on it, `y` copies it, `Enter` opens the toolbar ยท `V` selects whole rows ยท `i` moves the cursor with those keys first, so `v` can start mid-block ยท `j`/`k` or click selects a block ยท `c` comments on the block ยท `a` marks it looks good ยท `d` marks it for deletion ยท `x` clears the block's annotations ยท `X` clears every annotation on the document after a `y` ยท `/` searches the open file as shown, `n`/`N` step through the matches, `Esc` clears them ยท wide Markdown tables wrap by cell |
| selection toolbar | `a` ๐Ÿ‘ looks good ยท `c` ๐Ÿ’ฌ comment (opens a box at the selection) ยท `d` โœ— delete ยท `Esc` clears |
| comment box | `Enter` save ยท `Shift+Enter`, `Alt+Enter` or `Ctrl+J` new line ยท `โ†‘`/`โ†“` move by display row ยท `Ctrl+โ†`/`Ctrl+โ†’`, `Alt+โ†`/`Alt+โ†’` or `Alt+B`/`Alt+F` jump by word ยท `Ctrl+A`/`Ctrl+E` line start/end ยท `Ctrl+W`, `Alt+Backspace` or `Ctrl+Backspace` delete the previous word ยท `Alt+D` or `Ctrl+Delete` delete the next word ยท `Ctrl+U`/`Ctrl+K` delete to line start/end ยท `Esc` cancel, asking first if the text changed |
| rail | `j`/`k` move ยท `e` / `Enter` edit body ยท `x` remove ยท `I` attach a local image by path ยท `D` remove the last image ยท click a bubble to focus it |
| reply review | `S` send feedback and quit; stays open if the agent is at a dialog |
| gated review (`--gate`) | `A` approve, with any unsent notes ยท `E` send and finish ยท `q` dismiss; the decision is printed (`--json` for JSON) and, with `--result-file`, written there |
| file/folder review | `E` send new ยท `m` review menu (`R` resend all ยท `F` finish review ยท `U` undo ยท `H` archive) |
| tree | `j`/`k` move ยท `Enter` open ยท `.` show/hide hidden (dot-prefixed) entries ยท `E` send new feedback across files, including collapsed folders ยท counts show active notes per file |
| quick open (folder) | `Ctrl+P` find a Markdown file by name anywhere in the folder ยท type to filter ยท โ†‘/โ†“ or wheel select ยท `Enter` or click open ยท `Esc` cancel |
| archive | `j`/`k` or โ†‘/โ†“ select ยท `Enter` or click restore ยท `Esc` close |

Selections and exports are copied to the terminal clipboard (OSC 52).

Sent notes remain visible. File reviews send only new or edited notes by default;
`R` explicitly includes the sent ones too. `F` archives only sent notes that have not
changed since delivery. Archived notes survive restarts, and restoring them keeps their
ids and delivery history. Failed sends keep the feedback pending. The send button reads
`Send 3 new โ–ธ <agent> (E)` with notes to send, `Sent โœ“ โ–ธ <agent>` once they are sent, and
`<agent> at a dialog ยท retry (E)` when the agent cannot take them. The header shows the
send button and a `Review โ–พ (m)` button; its menu lists the four actions with live counts,
dims the ones with nothing to act on, and runs a row on `Enter`, a click, or the row's own
key. The keys also work directly, without the menu.

## Where things live

Every annotation is saved the moment it is made, as JSON, in the Plannotator data directory:

```
~/.plannotator/clients/plannotator-tui/annotations/<project>/<slug>/annotations.json
```

`<project>` and `<slug>` follow Plannotator's own rules (git repo name; basename + 8 hex of
sha256 of the path), so one file maps to one directory in both tools. The records are in the
Plannotator Workspaces wire shape (`plannotator-tui-schema`); any agent can read them. Nothing is
written next to your files. `PLANNOTATOR_DATA_DIR` relocates the directory. Transient
documents (an agent's last message, a pane's terminal output, stdin) are never persisted.

## Headless tools

```bash
plannotator-tui --export <file.md>                     # all active feedback to stdout; does not mark it sent
plannotator-tui --bench <file.md>                      # parse / render / reflow timings
plannotator-tui --blocks <file.md>                     # block index, kind, first row
plannotator-tui --annotate <file.md> <quote> <text> [comment|looks_good|delete] [--occurrence N]
plannotator-tui --annotate-block <file.md> <block> <text> [comment|looks_good|delete]
plannotator-tui --snapshot <file|folder> [cols rows scroll] [select-quote]   # one frame as text + mark map
plannotator-tui herdr terminal [--lines N] --print     # the focused Herdr pane's recent output, as the review document
```

## Measured (Apple Silicon, release build)

| corpus | blocks | rows | render + align | reflow on resize | row lookup |
|---|---|---|---|---|---|
| plugins.md (16 KB) | 60 | 305 | 14 ms | 0.7 ms | 20 ns |
| big.md (2.5 MB, 50k lines) | 14,100 | 56,999 | 352 ms | 50 ms | 15 ns |

Per frame, only visible rows are touched.

## Known limits

- Reference-style links and footnotes lose their target when a block is rendered alone.
- A whole list is one block for block-level commands; text selection is not affected.