Manage collections — indexed folders containing markdown files or other documents.
Usage
qmd collection < comman d > [options]
Subcommands
add
Create and index a new collection.
qmd collection add < pat h > [--name NAME] [--mask PATTERN]
Directory to index (use . for current directory)
Collection name (defaults to directory basename)
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.
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 < nam e >
qmd collection rm < nam e > # alias
Collection name to remove
Example:
qmd collection remove old-notes
rename
Rename a collection (updates virtual paths).
qmd collection rename < old-nam e > < new-nam e >
qmd collection mv < old-nam e > < new-nam e > # alias
Example:
qmd collection rename mynotes personal-notes
show
Display detailed information about a collection.
qmd collection show < nam e >
qmd collection info < nam e > # alias
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 < nam e > [command]
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 < nam e >
exclude
Exclude collection from default queries. Requires explicit -c <name> to search.
qmd collection exclude < nam e >
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