01 · Root CLI
Flags and exit codes.
| Flag | Meaning |
|---|---|
| [SOURCE]... | PDF, .tex, .md, .typ, .epub path, http(s) PDF/article URL, or arXiv ID/URL |
| --paper | Start in original paper colors instead of OKLab terminal theme |
| -w, --watch | Watch local .tex, .md, .typ, or .pdf for changes and reload live |
| --password <PASS> | Password for encrypted PDFs (falls back to HOJA_PDF_PASSWORD) |
| --text | Extract text headlessly to stdout (all pages or -p N) |
| --png | Render a page to PNG headlessly (-p N -o PATH --width 1600) |
| --perf | Show live FPS, frame time, and Kitty transport HUD in status bar |
| Exit code | Meaning |
|---|---|
| 0 | Success |
| 1 | Runtime error (bad color/style, missing libpdfium, unreadable file, invalid HOJA_DATA_DIR, no source) |
| 2 | Clap usage error (unknown flag or missing required flag) |
| 3 | no_match or no_live_reader |
| 4 | ambiguous match (retry with --occurrence K or --all) |
02 · Subcommands
annot, ctl, skills, and rex.
| Command | Key flags & purpose |
|---|---|
| hoja annot ls | --by human|agent|<slug>, -p, --stack, --json, --md |
| hoja annot add | --by, --match / --from+--to / --rect, -p, --color, --style, --note, --occurrence, --all, --dry-run |
| hoja annot apply | FILE or -, --by, --batch, --dry-run, --json (atomic batch) |
| hoja annot rm / note | ID..., --by (caller's own layer only; rejects human) |
| hoja annot clear | --by <slug> or --by agent, --batch (never touches human) |
| hoja annot export | --obsidian, -o, --include-agent, --force, --json |
| hoja ctl ls / status | --pid, --block, --json |
| hoja ctl open | TARGET, --focus, -p, --find, --by |
| hoja ctl switch / close | 1-based index or title substring |
| hoja ctl goto | --page, --y, --doc |
| hoja ctl peek | --text or --png -o <PATH> |
| hoja ctl search | QUERY, --limit 1..=200, --json |
| hoja skills list / get | core [--full], annotate, rex |
| hoja rex install / uninstall | Install or remove Rex Cmd+Shift+P Lua plugin |
03 · Privacy & Security
Local-only storage with 0600 permissions.
- Private files: Annotations, exports, caches, and handoff bundles write as 0600; runtime, stack, and handoff directories write as 0700.
- Multi-process locking: Annotation writes acquire an exclusive flock on <hash>.lock and rename atomically so the reader and agent panes never interleave partial JSON.
- No telemetry or stored secrets: Local reading never touches the network; PDF passwords stay in memory; remote URL query strings and credentials are stripped before saving titles or logs.