Problem
The terraphim-agent search command currently prints only rank + title, which makes it hard to use as a CLI for searching local notes/memory. For practical workflows (e.g. searching Clawdbot memory), we need file paths and a small snippet (or matching line numbers) to quickly locate the relevant source text.
Desired behavior
Add an option to terraphim-agent search to include source location and excerpt:
- Print
rel_path (or uri) for each result
- Print matching line numbers (or a short snippet)
- Ideally also show the matched query terms
Example output (human):
- 1 MEMORY docs/src/clawdbot-memory/MEMORY.md:4
WhatsApp gateway “flapping” mostly traced to an idle watchdog reconnect...
Notes
- Today the workaround is running
rg -n "<query>" <haystack> manually; this feature would make terraphim-agent usable as a self-contained search CLI.
- Should work at least for the Ripgrep haystack backend.
Acceptance criteria
terraphim-agent search --snippets "<query>" outputs path + line number(s) and a snippet per hit.
- Works in offline mode and server mode.