No description
Find a file
JMARyA 6592d4dc45
Some checks failed
ci/woodpecker/push/build/2 Pipeline failed
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build/1 Pipeline failed
feat: add --all-columns flag for exploratory schema inference
Scans all frontmatter via jsaw-core's infer_schema and auto-builds
columns from top-level fields sorted by coverage. Nested fields are
intentionally excluded — use -c for those once you know what's there.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:11:14 +01:00
.woodpecker slaves 2025-06-28 01:39:13 +02:00
src feat: add --all-columns flag for exploratory schema inference 2026-03-04 09:11:14 +01:00
.gitignore init 2023-10-25 16:33:12 +02:00
Cargo.lock feat: add --all-columns flag for exploratory schema inference 2026-03-04 09:11:14 +01:00
Cargo.toml Add dependencies and update code for jsaw-core 2026-03-01 14:05:19 +01:00
Dockerfile update 2025-10-31 18:39:20 +01:00
flake.lock chore: nix flake 2025-11-30 22:24:14 +01:00
flake.nix chore: nix flake 2025-11-30 22:24:14 +01:00
PKGBUILD PKGBUILD 2025-06-28 01:28:04 +02:00
README.md feat: add task extraction via --tasks flag 2026-03-04 07:47:20 +01:00
renovate.json Add renovate.json 2025-06-21 21:37:59 +00:00

Markdown Query

MDQ is a command line tool to query markdown documents which have yaml frontmatter.

Usage

Usage: mdq [OPTIONS] <dir>

Options

Option Description
-j, --json Output result as JSON
-l, --limit <LIMIT> Limit number of results returned [default: 0]
--offset <OFFSET> Offset results by a factor. Useful when used with --limit [default: 0]
-f, --filter <FILTER> Filter to apply to the documents. See filter section below.
-c, --column <COLUMN> Specify output columns. You can rename the text displayed in the header using the : character like this: VariableName:OutputName [default: file.title:Title]
-s, --sortby <KEY> Sort results based on specified key
-g, --groupby <KEY> Group results based on specified key
-r, --reverse Reverse the results
--noheader Dont print header in CSV mode. Useful for scripting
-t, --inline-tags Search for inline #tags and include them in frontmatter
--tasks Extract GFM task list items and expose tasks, tasks_done and tasks_open fields

Filters

You can query your document using filters. MDQ uses jsonfilter, so you can query similiar to the find() function of MongoDB.

Examples:

# Select documents with version 1.0
mdq -c file.title:Title -f '{"version": "1.0"}' ./docs

# Select documents which are high priority and assigned to me
mdq -c file.title:Title -f '{"priority": "high"}' -f '{"assigned": "me"}' ./docs

# Select documents which are assigned to names starting with A or B
mdq -c file.title:Title -f '{"$or": [{"assigned": {"$regex": "^A"}}, {"assigned": {"$regex": "^B}}]}' ./docs

Tasks

When using --tasks, MDQ extracts GFM task list items from the document body and exposes them as queryable fields:

Field Type Description
tasks array All task items as {text, done} objects
tasks_done integer Number of completed tasks
tasks_open integer Number of incomplete tasks

Examples:

# Show task counts per document
mdq --tasks -c file.title:Title -c tasks_done:Done -c tasks_open:Open ./docs

# Find documents that still have open tasks
mdq --tasks -f '{"tasks_open": {"$gt": 0}}' -c file.title:Title -c tasks_open:Open ./docs