idx

search

Purpose

Search indexed project content using BM25 ranking and optional metadata filters.

Usage

idx search [query terms] [flags]

Arguments

Flags

Flag Type Default Notes
--format string text Allowed: text, json
--json-pretty bool false Requires --format json
--explain bool false Includes ranking score
--agent-compact bool false Compact text output for agents (no header/footer spacing, simplified lines)
--context int 0 Must be >= 0
--matches-only bool false Keeps only matching lines
--files-only bool false Returns only file paths
--path string array [] Repeatable metadata-path filter
--ext string array [] Repeatable file-extension filter (go or .go)
--from int 0 Pagination offset, must be >= 0
--size int unset (0) If set, must be > 0
--operator string AND Boolean operator for multi-term queries: AND or OR
--relaxation string unset Only with --operator AND. Format >N; activates relaxation only when query has more than N terms, then removes trailing terms progressively
--quiet, -q bool false Suppress informational output

Compatibility alias:

Behavior and Side Effects

Output

Examples

idx search auth token
idx search auth token --format json --json-pretty
idx search auth token --explain
idx search auth token --format json --explain
idx search auth token --agent-compact
idx search auth token --context 2
idx search --path internal/core
idx search --ext go
idx search --path internal/core --ext go
idx search auth token --from 10 --size 5
idx search auth token --files-only
idx search auth token --matches-only
idx search auth token --operator OR
idx search auth token --operator AND
idx search func abc x y int 10 --operator AND --relaxation '>2'

Errors