mdsmith list query

May 24, 2026 · View on GitHub

Print paths of Markdown files whose front matter satisfies a CUE expression.

mdsmith list query [flags] <cue-expr> [files...]

With no file arguments, searches the current directory recursively. Files without front matter are skipped (use --verbose to see the reasons on stderr).

Flags

FlagDefaultDescription
-c, --configautoOverride config path
-0, --nullfalseNUL-delimit output (for xargs -0)
-v, --verbosefalsePrint skipped files on stderr
--max-input-size2MBMax file size (e.g. 2MB, 0=none)

Examples

mdsmith list query 'status: "✅"' plan/
mdsmith list query '#mdsxx & {status: "ready"}' internal/rules/
mdsmith list query -0 'kinds: [..."plan"...]' . | xargs -0 wc -l

The expression is full CUE — match scalars, regex, list membership, optional fields, and structural shapes.

Exit codes

CodeMeaning
0At least one match
1No matches
2Runtime/parse error