Skip to content

Accept -o json on kernel search commands - #297

Open
chruffins wants to merge 2 commits into
mainfrom
hypeship/search-json-output-flag
Open

chruffins wants to merge 2 commits into
mainfrom
hypeship/search-json-output-flag

Conversation

@chruffins

@chruffins chruffins commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • kernel search, search get, search providers, and search contents rejected -o json with Unknown shorthand flag. Other commands accept it, and the search output is already JSON.
  • Register the shared -o/--output flag on the four search commands. It accepts json or nothing, and is validated before the request, so a bad value does not run a billable search.
  • Document the --content-max-chars range (100–100000, default 10000) in the flag help and the README. The server enforces this range, so the CLI does not clamp.

Testing

  • go test ./cmd/... passes. New cases cover -o json on get/providers/contents and invalid -o yaml on search, get, and contents, with no API call expected.

Not in this PR

  • contents --request was never a CLI flag. The agent instructions that showed it are fixed separately in kernel/hypeship.

Search commands always print JSON, but they rejected the -o flag that
other commands accept, so scripts piping through jq got an error on
stderr instead of JSON. Register the shared output flag on search,
get, providers, and contents, and validate it before any request is
sent.
@chruffins
chruffins marked this pull request as ready for review October 13, 2026 23:13
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.

1 participant