feat: search + open convenience commands#64
Merged
Conversation
- deepdive search "<query>": run just the search adapter, print raw results (no LLM/fetch). Honors --search/--json; --results-per-query sets the count (default 10). For previewing a backend or debugging an adapter. - deepdive open <id>: render a session to a self-contained HTML file (temp dir or --out) and open it in the default browser; the path is always printed so it works headless. Cross-platform opener selected by a pure, tested browserOpenCommand (target passed as a single argv entry — no shell). New src/open.ts; exported from the library. 4 new tests (572 total green).
… shell) Eliminates the cmd.exe shell from the Windows opener so the file path can never be interpreted as a command — clears CodeQL js/shell-command- injection-from-environment. open()/xdg-open were already shell-free.
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
Two small, high-utility commands.
deepdive search "<query>"Run just the search adapter and print the raw candidate list — no LLM, no fetch, no browser. Honors
--searchand--json;--results-per-querysets the count (default 10). Cheap way to preview a backend or debug an adapter.deepdive open <id>Render a saved session to a self-contained HTML file (temp dir, or
--out=<path>) and open it in the default browser. The file path is always printed, so it works on a headless box even when the opener isn't available. The browser spawn is best-effort (child.on('error')swallows a missing opener).Design
src/open.ts—browserOpenCommand(platform, target)is a pure, tested selector (open/xdg-open/cmd /c start "" …). The target is the final argv entry passed straight tospawn(no shell → no injection); Windows gets the empty""title arg so a spaced path isn't read as the window title.Tests
4 new (
browserOpenCommandper platform). 572/572 green,tsc --strictclean. Both commands smoke-tested end-to-end:searchagainst the live HN/SO APIs,openwriting a valid HTML report + printing the path.