Skip to content

Comments

feat: add --json option to search command#65

Open
s21v1d9p wants to merge 2 commits intomixedbread-ai:mainfrom
s21v1d9p:feat/json-output
Open

feat: add --json option to search command#65
s21v1d9p wants to merge 2 commits intomixedbread-ai:mainfrom
s21v1d9p:feat/json-output

Conversation

@s21v1d9p
Copy link

@s21v1d9p s21v1d9p commented Dec 3, 2025

This PR adds a --json option to the search command to output results in JSON format. Fixes #46.


Note

Adds a --json flag to mgrep search to output raw JSON for search and answer responses, with accompanying tests.

  • CLI / Search Command
    • Add --json option to src/commands/search.ts.
    • When --json is set:
      • For search: print store.search results as JSON.
      • For answer: print store.ask results as JSON.
    • Preserve existing formatted output when --json is not used.
  • Tests (test/test.bats)
    • Add tests for --json output, --json --answer, and --json with no results.

Written by Cursor Bugbot for commit ddeb8e3. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add --json for search

1 participant