Skip to content

cli: add code search via peregrine (ENT-993, ENT-994) - #2380

Draft
entire[bot] wants to merge 2 commits into
mainfrom
evis/ent-990-cross-region-code-search-cli-peregrine-us-first-then-eu
Draft

cli: add code search via peregrine (ENT-993, ENT-994)#2380
entire[bot] wants to merge 2 commits into
mainfrom
evis/ent-990-cross-region-code-search-cli-peregrine-us-first-then-eu

Conversation

@entire

@entire entire Bot commented Sep 11, 2026

Copy link
Copy Markdown

https://entire.io/gh/entireio/cli/trails/739

This draft pull request was opened by Entire after CI was requested for the linked trail. Feel free to edit the title or body — the link above is what keeps the trail and PR connected.

evisdren and others added 2 commits July 2, 2026 12:57
Add `entire search --code <query>` to search code content through
peregrine via entire-api cells. Gated behind ENTIRE_CODE_SEARCH=1
env var so it stays dark until launch.

- New `codesearch` package: client for peregrine's /search/api/search
  endpoint with request/response types matching the peregrine API
- Auth via NewEntireAPICellClient (jurisdictional identity tokens),
  same pattern as `entire api --to cell`
- Output modes: grep-style text (terminal) or JSON (--json / piped)
- Flags: --code, --case-sensitive, --repo, --limit
- Rejects incompatible flags (--page, --all-repos, --case-sensitive
  without --code) with clear error messages
- Response overflow detection (8 MiB cap with explicit error)
- Timeout scoped to the search call only (30s), not auth resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Parse inline repo: filters for --code path (was passing them as
  literal query text to peregrine)
- Handle repo:* and --all-repos with --code as "no filter" instead
  of passing literal "*" to the API
- Use api.ErrorResponse/HTTPError for error parsing instead of
  inline struct (supports both legacy and newer error envelopes)
- Fix --limit help text to clarify behavior differs for --code
- Drop --page/--all-repos rejection (silently ignored is less
  disruptive than breaking shared scripts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant