How do I find docs matching a pattern?
For the companion lookup "show me one doc by UUID" see How do I show a doc by UUID?.
Question
How do I find documents in the repo when I know a fragment of the title, a tag, the doctype, or roughly which folder it lives in?
Answer
Run ./projects/ores.compass/compass.sh list with one or more filters.
Each filter narrows the result; combining filters AND's them.
Regex on title or description (case-insensitive):
./projects/ores.compass/compass.sh list --regex 'currency'/By
#+type:/ — recipe, knowledge, task, story, sprint, version, component, capture, function, skill, meta, …:./projects/ores.compass/compass.sh list --type recipe ./projects/ores.compass/compass.sh list --type knowledge
By filetag (repeatable; multiple tags are AND'd):
./projects/ores.compass/compass.sh list --tag cli ./projects/ores.compass/compass.sh list --tag build_quality --tag task
Under a path prefix — restrict to one subtree (repeatable):
./projects/ores.compass/compass.sh list --under doc/agile/versions/v0 ./projects/ores.compass/compass.sh list --under doc/recipes/cli
Combine filters for a precise lookup:
./projects/ores.compass/compass.sh list \ --type recipe --tag cli --regex 'list'
Just count how many docs match — useful for sanity checks:
./projects/ores.compass/compass.sh list --type recipe --count
Pipe paths into grep/xargs when you want to read or edit the matched files:
./projects/ores.compass/compass.sh list --tag cli --paths | \ xargs grep -l 'compute_host'
Sort by recency — most recently touched first:
./projects/ores.compass/compass.sh list --sort updated | tail -20
Output format
Each match is one line:
<uuid> | <type> | <title> — <description> (rel/path)
The --paths mode emits one path per line for use in pipes; --count
emits a single integer.
Script
The wrapper is projects/ores.compass/compass.sh list. It delegates to
projects/ores.compass/src/doc_list.py, which uses the shared
doc_index.py library (see How do I show a doc by UUID? for the model).
Tested by
Manual usage — these scripts are read-only over the doc tree, so the
#+type:, #+filetags:, and :ID: contract enforced by
document types and audited by lifecycle is what guarantees
correctness.
See also
- How do I show a doc by UUID? — pivot from a UUID found via list to the full document context.
- Document types — the
#+type:taxonomy the--typefilter works against. - Recipes index.