Skip to main content
Fetch and display a single document from the index.

Usage

qmd get <file>[:line] [options]
file
string
required
Document identifier. Can be:
  • Virtual path: qmd://collection/path/file.md
  • Collection/path: collection/path/file.md
  • Filesystem path: /full/path/file.md or ~/relative/path.md
  • Filename: readme.md (fuzzy match)
  • Docid: #abc123 or abc123 (6-character hash)
  • With line number: file.md:42

Options

--from
number
Start line number (1-indexed)
-l
number
Maximum number of lines to display
--line-numbers
boolean
default:"false"
Add line numbers to output

Examples

By Virtual Path

# Full virtual path
qmd get qmd://notes/readme.md

# Collection and path
qmd get notes/readme.md

By Filesystem Path

# Absolute path
qmd get /home/user/notes/readme.md

# Home directory
qmd get ~/notes/readme.md

# Relative path (from current directory)
qmd get ./readme.md

By Filename (Fuzzy)

# Matches any file ending with "readme.md"
qmd get readme.md

# Matches any file ending with "installation.md"
qmd get installation.md

By Docid

# With # prefix
qmd get "#abc123"

# Without prefix
qmd get abc123
Docids are shown in search results and multi-get output.

Line Ranges

# Start at line 100
qmd get readme.md:100

# Start at line 50, show 20 lines
qmd get readme.md --from 50 -l 20

# Show lines 10-30 with line numbers
qmd get readme.md:10 -l 20 --line-numbers

Output Format

If the document has context metadata, it’s displayed as a header:
Folder Context: Meeting notes from Q1 2025
---

[document content]
With --line-numbers, output is formatted like cat -n:
     1	# Readme
     2	
     3	This is the readme file.

Path Resolution Priority

  1. Docid lookup — If input looks like a docid (#abc123)
  2. Virtual path — If starts with qmd://
  3. Collection/path — If first component is a known collection name
  4. Filesystem path — Absolute or relative path, mapped to collection
  5. Fuzzy filename — Match by filename suffix

qmd multi-get

Retrieve multiple documents

qmd search

Search for documents

qmd ls

List files in a collection

Build docs developers (and LLMs) love