annotui
annotui is a mouse-first terminal UI for commenting on files and piped text. It gives an immutable buffer a GitHub-style review surface, then writes the review as concise Markdown or JSON.
|
Drag across source lines and release to open the inline comment editor. Enter saves the comment. Existing comments remain visible below their ranges; reach them with Up/Down and press Enter, or click one, to edit it.
Install
Install from crates.io with Rust 1.88 or newer:
Or build from source:
Output
The default comments format writes only reviewed ranges and comments:
human comment here ...
The TUI uses /dev/tty, leaving standard output clean for pipelines:
|
--format full quotes the whole input and inserts comments after their selected
ranges. --format json writes the versioned line-range model. See
the output format reference for exact behavior.
Use --comments review.json to load and save a JSON sidecar while still choosing an
independent final output format:
The sidecar includes a source hash. annotui refuses to apply it to different content
instead of silently moving comments to the wrong lines.
--comments and --output must name different files.
Controls
Mouse controls:
- Drag source lines and release to comment on the range.
- Click a comment to edit it.
- Use the wheel to scroll the document or active editor.
- Saved ranges keep a green rail beside every source line they cover.
- Long source lines wrap to the available terminal width.
Keyboard controls:
| Key | Action |
|---|---|
j / k, Up/Down |
Move between source lines and inline comments |
Shift-Up / Shift-Down |
Select a range; release Shift to write the comment |
v |
Start or cancel range selection |
Enter |
Comment on a source range, edit a focused comment, or save the editor |
Ctrl-O |
Insert a newline in a comment |
Esc |
Cancel selection or editing |
e / d |
Edit or delete a focused comment or one on the cursor line |
[ / ] |
Jump to the previous/next comment |
Alt-Z |
Toggle source-line word wrapping (on by default) |
q |
Write output and quit |
Pass --no-mouse when terminal mouse capture is undesirable. Native terminal text
selection is unavailable while mouse capture is active.
Requirements and limits
annotui is a Unix utility and requires a controlling terminal at /dev/tty. Input
must currently be valid UTF-8. Source text is never modified.
Fun fact: annotui was built in 13 user messages.