LinuxCommandLibrary

mq

Command-line tool for querying and transforming Markdown files

TLDR

Extract headings from a Markdown file
$ mq 'headings' [path/to/file.md]
copy
Filter content by section
$ mq 'select("Section Name")' [path/to/file.md]
copy
Launch interactive REPL mode
$ mq --repl [path/to/file.md]
copy

SYNOPSIS

mq [options] query [file]

DESCRIPTION

mq is a command-line tool for processing and querying Markdown files, inspired by jq for JSON. It lets you slice, filter, map, and transform structured Markdown content directly from the terminal with built-in filters and functions, plus support for custom extensions.
Useful for preparing structured prompts for language models, automating documentation updates, and analyzing content across multiple Markdown files.

PARAMETERS

--repl

Launch interactive REPL mode for testing queries.

CAVEATS

Queries follow mq's own filter syntax. Complex transformations may require chaining multiple filters.

HISTORY

mq was created by harehare and is written in Rust.

SEE ALSO

jq(1), glow(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard