repos

Search within a repo session using rg-style lexical matching over the live session workspace.

Search within a repo session using rg-style lexical matching over the live session workspace. This is scoped code/file search, not semantic retrieval. When mode=regex, patterns must be valid JavaScript RegExp syntax (not Python/PCRE inline flags).

Org permission: package:read.

get/v1/repo-sessions/{session_id}/search

Request

  • Base URL: https://api.kody.codes
  • URL: https://api.kody.codes/v1/repo-sessions/{session_id}/search
  • Auth: HTTP bearer

Path parameters

session_idstring required

Active repo session id from repoOpenSession or repoListSessions.

Query parameters

patternstring required

Literal text or regex to search for. In regex mode this must be valid JavaScript RegExp syntax (no Python/PCRE inline flags such as (?s) or (?i)).

mode'literal' | 'regex'

Search mode. Defaults to literal. regex uses JavaScript RegExp syntax.

globstring

Optional glob filter for files to search.

pathstring

Optional repo-relative subpath to scope the search to.

case_sensitiveboolean

Whether matching should be case-sensitive.

beforeinteger

Lines of context to include before each match.

afterinteger

Lines of context to include after each match.

limitinteger

Maximum number of matches to return before truncation.

output_mode'content' | 'files'

Whether to return match content or just files with matches.

Response

Success.

total_filesinteger required
total_matchesinteger required
output_mode'content' | 'files' required
truncatedboolean required

Changes

No recorded changes to this operation across all 3 revisions of this API.