Skip to main content
Manage collections — indexed folders containing markdown files or other documents.

Usage

qmd collection <command> [options]

Subcommands

add

Create and index a new collection.
qmd collection add <path> [--name NAME] [--mask PATTERN]
path
string
required
Directory to index (use . for current directory)
--name
string
Collection name (defaults to directory basename)
--mask
string
default:"**/*.md"
Glob pattern for files to index
Examples:
# Index current directory with default name
qmd collection add .

# Index with custom name
qmd collection add ~/Documents/notes --name mynotes

# Index all text files
qmd collection add ~/docs --name docs --mask '**/*.txt'

list

List all indexed collections with stats.
qmd collection list
Shows collection name, virtual path, glob pattern, file count, last update time, and whether excluded from default queries.

remove

Remove a collection and all its indexed documents.
qmd collection remove <name>
qmd collection rm <name>  # alias
name
string
required
Collection name to remove
Example:
qmd collection remove old-notes

rename

Rename a collection (updates virtual paths).
qmd collection rename <old-name> <new-name>
qmd collection mv <old-name> <new-name>  # alias
old-name
string
required
Current collection name
new-name
string
required
New collection name
Example:
qmd collection rename mynotes personal-notes

show

Display detailed information about a collection.
qmd collection show <name>
qmd collection info <name>  # alias
name
string
required
Collection name
Shows path, glob pattern, include status, update command, and context count.

update-cmd

Set a shell command to run before indexing (e.g., git pull).
qmd collection update-cmd <name> [command]
name
string
required
Collection name
command
string
Shell command to run before indexing. Omit to clear the command.
Examples:
# Set git pull as update command
qmd collection update-cmd brain 'git pull'

# More complex update command
qmd collection update-cmd notes 'git stash && git pull --rebase --ff-only && git stash pop'

# Clear update command
qmd collection update-cmd brain

include

Include collection in default queries (when no -c filter specified).
qmd collection include <name>
name
string
required
Collection name

exclude

Exclude collection from default queries. Requires explicit -c <name> to search.
qmd collection exclude <name>
name
string
required
Collection name
Example:
# Exclude archive from default searches
qmd collection exclude archive

# Later search only archive explicitly
qmd query "old notes" -c archive

Virtual Paths

Collections use virtual path format: qmd://<collection>/<path> Examples:
  • qmd://notes/readme.md
  • qmd://journals/2025/may.md

qmd update

Re-index all collections

qmd ls

List files in a collection

qmd context

Add context to collections

qmd status

View collection health

Build docs developers (and LLMs) love