Skip to content

rg → rtk grep: handle multiple file paths + reduce output-format surprise #17

@PLNech

Description

@PLNech

The hook rewrites rg <pat>rtk grep <pat> (and rtk grep runs ripgrep underneath — good). Two ergonomic rough edges show up when agents use it:

  1. Single path positional. rtk grep takes one path (main.rs, default .). A multi-file invocation like rg -n "a|b" f1.py f2.py f3.py doesn't map cleanly — extra files can be dropped. Repro: rtk grep "x" a.rs b.rs reports only one file.
  2. Output format differs from raw rg. rtk grep emits a grouped [file] path (N): form and caps results (max 200, line-len 80); agents expecting rg's path:line:content adapt or get confused (observed in the wild — an agent assumed "rg got rewritten to grep").

Options: accept multiple path positionals; and/or document the escape hatch (rtk proxy rg ... for raw output) more prominently. Good fuzzer target. Not a regression — long-standing behavior — but worth smoothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions