Skip to main content

Synopsis

dms search --dir DIRECTORY [FILTERS]

Description

dms search scans every .json file in a directory, loads the records, and applies the filters you specify. All filter conditions are combined with AND logic — a record must satisfy every active filter to appear in the results. Results are printed as a formatted table showing filename, title, type, language, and creator. Add --verbose to also print a truncated description below the table.

Options

--dir
path
required
Directory of DMS records to search. Must exist and must be a directory.
--type
string
default:"None"
Filter by heritage type. Must be an exact match (e.g., poem, story, photo).
--subject
string
default:"None"
Filter by subject tag. Partial, case-insensitive match against each value in the subject array (e.g., --subject displacement matches forced displacement).
--creator
string
default:"None"
Filter by creator name. Partial, case-insensitive match against the name field of each creator object.
--language
string
default:"None"
Filter by language code. Exact match (e.g., en, sw, fr).
--from
string
default:"None"
Include only records whose date.created is on or after this date. Format: YYYY-MM-DD.
--to
string
default:"None"
Include only records whose date.created is on or before this date. Format: YYYY-MM-DD.
--query
string
default:"None"
Free-text search. Case-insensitive substring match across title, description, and subject values.
--verbose
boolean
default:"false"
Show a truncated description (up to 120 characters) for each matching record below the results table.

Examples

dms search --dir records/ --type poem

Notes

Records with no date.created field are excluded when --from or --to is used, because there is no date to compare against.
Combine --query with --type to quickly narrow results: dms search --dir records/ --type poem --query "memory".
JSON files containing a top-level array are also searched — each element of the array is treated as a separate record, identified by filename[index] in the results table.