Repository navigation
feat(cli): rat grep for transcript search - #6
Merged
Merged
Conversation
New `rat grep <pattern>` subcommand that scans PtyOutput events across
session logs for a substring. Uniquely enabled by the event-log
design: works against live sessions, dead sessions with metas still
on disk, or any raw .log file — no daemon round-trip needed.
Flags:
- `-s, --session <id|name>` — limit to one session
- `--log <path>` — scan a specific log file
- `--raw` — match raw bytes; default strips ANSI so colored prompts
and editor decorations don't interfere with the match text.
Output format: `{session_short}:{seq}: {line}`, which composes cleanly
with unix piping. Plain substring match only for MVP; regex is a
natural follow-up.
Adds a tiny CSI-only ANSI stripper inline rather than pulling in
`vte` — grep only needs to drop color codes from match lines, full
terminal emulation would be overkill.
seamoss
force-pushed
the
feat/grep-transcript
branch
from
April 24, 2026 23:18
656e221 to
a8c598f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`rat grep ` scans PtyOutput events across session logs. Works against live sessions, dead sessions with metas on disk, or any raw .log file — no daemon round-trip.
```sh
rat grep ERROR # all sessions
rat grep ERROR -s agent # single session
rat grep ERROR --log path.log # specific file
rat grep "\x1b\[31m" --raw # raw-byte match
```
Output: `{session_short}:{seq}: {line}`. Default strips ANSI; `--raw` matches literal bytes.
Test plan