feat: add stdin piping support for search command#45
feat: add stdin piping support for search command#45andrewgazelka wants to merge 1 commit intomixedbread-ai:mainfrom
Conversation
- Add tryReadStdin() to detect and read piped stdin data - Add uploadBuffer() to upload stdin content to store - Auto-detect stdin mode and sync content before searching - Use SHA-256 hash for stdin caching (__stdin__/<hash>) - Display <stdin> in search results for stdin-originated content - Add tests for stdin piping functionality
|
Hey, I'm a bit puzzled with this use case. While we strive to support My main problem is that we don't return lines but chunks, and chunks are typically way bigger than lines. For most smaller input this leads to a search over just one chunk, which does not make sense. On the other hand semantic search in a single big file might make sense. Do you have a specific use case for this? |
The provided example This should be done by agents see https://imandrew.pages.dev/thoughts/mcp-not-enough |
can't test as on free tier rn lol. rn AI assisted haven't looked carefully. will do if you agree this makes sense
Summary
git log | mgrep search "query"orcat file.txt | mgrep search -a "what is this?"__stdin__/<hash>)Test plan
pnpm test- all 24 tests passecho "test content" | mgrep search "test"<stdin>in outputNote
Add stdin piping to
mgrep search, uploading and indexing piped content under__stdin__/<hash>and showing results as<stdin>.searchoraspinner); skips normal--syncwhen stdin is used.__stdin__/<hash>and renders it as<stdin>in output; scoping prefers stdin path when present.--content, and--answermodes.tryReadStdin(non-blocking stdin read) anduploadBuffer(direct buffer upload); reusecomputeBufferHash.Written by Cursor Bugbot for commit 941c5c8. This will update automatically on new commits. Configure here.