bdbt_annotator 0.2.2

TUI-based code change reviewer for browsing diffs and adding annotations
# Annotator

A TUI-based code change reviewer. Browse diffs, add comments to specific lines, then export annotations for LLM-assisted code improvement.

## Build & Run

```bash
cargo build --release

# From git commit range
annotator HEAD~3..HEAD

# From diff file
annotator -f changes.diff

# From piped diff
git diff main..feature | annotator

# Use annotation file (loads if exists, saves to same path)
annotator -f changes.diff -A annotations.json

# Export existing annotations
annotator -f changes.diff -A annotations.json -o review.md --format llm
```

## Architecture

- `src/cli.rs` - CLI argument parsing (clap derive)
- `src/model/diff.rs` - Unified diff parser and domain model
- `src/model/annotation.rs` - Annotation storage (JSON-based)
- `src/input/` - Input sources: stdin/file, git commit range
- `src/tui/` - ratatui-based TUI (app state, widgets, key handling)
- `src/lsp/` - LSP client for go-to-definition and hover (JSON-RPC over stdio)
- `src/output/export.rs` - Export formats: llm, json, markdown

## TUI Keybindings

- `j/k` or arrows: navigate diff lines
- `h/l` or left/right: move column cursor
- `w/b`: word forward/backward
- `c`: add comment on current line
- `e`: edit existing comment
- `d`: delete comment
- `V`: visual line selection
- `y`: yank line/selection to clipboard
- `n/m`: next/prev file (or next/prev search match when search active)
- `[/]`: jump to prev/next hunk
- `Tab`: switch to file list
- `s`: save annotations (prompts for path if `-A` not given)
- `x`: export annotations
- `/`: search in current file diff
- `z`: toggle context fold (hide unchanged lines)
- `f`: toggle full file view
- `?`: help overlay
- `gg/G`: top/bottom
- `Ctrl-d/Ctrl-u`: half page down/up
- `Ctrl-o/Ctrl-i`: jump list back/forward
- `gd`: go to definition (LSP)
- `K`: hover info (LSP)
- `Esc`: clear search
- `q`: quit