Rich Format (Default)
The rich format uses the Rich library to display beautifully formatted results in your terminal.Rich Output Features
- Results Table
- Top Match Panel
- Styling
The results are displayed in a table with:
- Rank number (1-5 by default)
- Score (distance/BM25 score/RRF)
- Filename (highlighted in green)
- Path (dimmed, with middle truncation for long paths)
- Snippet (preview of content)
Visual Example:
src/output.py:84-126
Plain Text Format
Plain text output is simple, unformatted text suitable for piping to other commands or logging.Plain Output Structure
src/output.py:65-81
JSON Format
JSON output provides structured data for programmatic access and integration with other tools.JSON Schema
JSON Generation
src/output.py:39-63, src/output.py:129-160
Benchmark JSON
When using--benchmark, JSON includes both dense and BM25 results:
src/output.py:134-149
Format Comparison
- Rich (Default)
- Plain
- JSON
Best for:
- Interactive terminal use
- Quick visual scanning
- Exploring results
- Daily workflow
- ✅ Beautiful formatting
- ✅ Color highlighting
- ✅ Easy to read
- ✅ Extended preview panel
Text Previews
All formats include text previews with varying lengths:- Table snippets: 200 characters
- Top match (rich/plain): 800 characters
- JSON snippets: 200 characters
src/output.py:15-17
Integration Examples
Using jq with JSON Output
Python Integration
Shell Scripting
Output File Writing
Save JSON results to a file:src/output.py:59-62
Format Selection Logic
- Default:
rich - If
--plain:plain - If
--json:json --plainand--jsontogether is an error
src/know.py:127-136, src/output.py:129-160
Common Workflows
Interactive Exploration
Text Processing
Data Analysis
Archival
Next Steps
Search Modes
Learn about dense, BM25, and hybrid search
Filtering
Filter results by patterns and time