Skip to content

Feature: terraphim-agent search should output file paths + matching snippets/line numbers #499

@AlexMikhalev

Description

@AlexMikhalev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions