Available Formats
All formats are available forsearch, query, vsearch, and multi-get commands:
| Flag | Format | Best For |
|---|---|---|
--json | JSON | API integration, parsing, structured data |
--csv | CSV | Spreadsheets, data analysis, tabular export |
--md | Markdown | Documentation, reports, readable export |
--xml | XML | Legacy systems, RSS feeds, structured exchange |
--files | Files list | Quick reference, shell scripting |
| (default) | CLI | Human reading in terminal |
JSON Format
Structured data with all metadata included. Usage:docid: Short document ID (6-character hash prefix) - use withqmd get #abc123score: Relevance score 0-1 (search only)file: Virtual path inqmd://collection/pathformatcontext: Folder context if configured (omitted if null)snippet: Extracted relevant text (search) orbody: Full content (multi-get)skipped: Boolean indicating if file was too large (multi-get)
CSV Format
Tabular format for spreadsheet import and data analysis. Usage:- Headers included in first row
- Fields with commas/quotes/newlines are quoted per RFC 4180
- Empty context fields show as blank (not “null”)
- Compatible with Excel, Google Sheets, pandas
Markdown Format
Human-readable format suitable for documentation and reports. Usage:Initial Setup
Follow these steps to get started:- Clone the repository
- Install dependencies …
- H1/H2 headings for document titles
- Bold metadata labels
- Code blocks for full content
- Horizontal rules separate results (search)
- Blockquotes for skip messages
XML Format
Structured format for legacy systems and RSS-like feeds. Usage:- Self-closing document declaration
- Attributes for metadata (search)
- Elements for structured data (multi-get)
- Proper XML entity escaping (
<,>,&,",')
Files Format
Minimal format showing just paths, scores, and context. Usage:- Search:
#docid,score,path,"context" - Multi-get:
path,"context"orpath,"context",[SKIPPED] - Context quoted if present, omitted entirely if null
- Ideal for piping to other tools:
qmd search "term" --files | cut -d, -f3
CLI Format (Default)
Colored, human-readable output for terminal use. Usage:- Syntax highlighting and colors (disabled if
NO_COLORenv var set) - Visual separators between results
- Compact score display
- Context shown when available
- Optimized for terminal width
- Skip messages for large files
Format-Specific Options
Line Numbers
Add line numbers to output (all formats except —files):Full Content
Show complete documents instead of snippets (search only):--full: Returns ~300 character snippets around matching text
With --full: Returns entire document content
Default Limits by Format
| Format | Default -n | Reason |
|---|---|---|
| CLI | 5 | Terminal readability |
| JSON | 20 | API pagination |
| CSV | 5 | Focused results |
| Markdown | 5 | Document length |
| XML | 5 | Payload size |
| Files | 20 | Compact listing |
-n <number> or --all (returns up to 100,000 results with --min-score filtering).
Common Patterns
Export to file
Pipe to processing tools
Combine with grep/awk
Import to spreadsheet
Generate documentation
Multi-Get Size Limits
By default,multi-get skips files larger than 10KB (10,240 bytes) to prevent overwhelming output.
Adjust the limit:
- JSON:
{"file": "...", "skipped": true, "reason": "File too large..."} - CSV:
"...",true,"File too large..." - Markdown:
> File too large (80KB > 10KB). Use 'qmd get ...' to retrieve. - XML:
<skipped>true</skipped><reason>...</reason> - Files:
...,[SKIPPED] - CLI:
[SKIPPED: File too large...]
See Also
- Filtering Options - Collection filters, score thresholds, result limits
- Search Commands - Search, query, and vsearch command reference
- Multi-Get - Batch document retrieval