Query. Filter.
Transform Markdown.

A command-line tool that processes Markdown using a syntax similar to jq. Written in Rust — slice, filter, map, and transform with ease.

bash — mq query
$ cat README.md | mq '.list | to_text()'
# Output:
Slice and Filter
Map and Transform
Command-line Interface

What is mq?

mq is a command-line tool that processes Markdown using a syntax similar to jq. It's written in Rust, allowing you to easily slice, filter, map, and transform structured data.

mq demo

Why mq?

mq makes working with Markdown files as easy as jq makes working with JSON. It's especially useful for:

smart_toy
auto_awesome

LLM Workflows

Efficiently manipulate and process Markdown used in LLM prompts and outputs.

description
library_books

Documentation Management

Extract, transform, and organize content across multiple documentation files.

bolt
batch_prediction

Batch Processing

Apply consistent transformations across multiple Markdown files with sub-millisecond execution.

input_circle
format_align_left

LLM Input Generation

Generate structured Markdown content optimized for LLM consumption, since Markdown serves as the primary input format for most language models.

search
manage_search

Content Analysis

Quickly extract specific sections or patterns from Markdown documents with precise node selection.

Since LLM inputs are primarily in Markdown format, mq provides efficient tools for generating and processing the structured Markdown content that LLMs require.

Features

A comprehensive set of primitives designed for deep structural manipulation of the web's most popular document format.

filter_list

Slice and Filter

Extract specific parts of your Markdown documents with ease.

transform

Map and Transform

Apply transformations to your Markdown content.

terminal

Command-line Interface

Simple and intuitive CLI for quick operations.

extension

Extensibility

Easily extendable with custom functions.

support

Built-in Support

Filter and transform content with many built-in functions and selectors.

keyboard_arrow_right

REPL Support

Interactive command-line REPL for testing and experimenting.

code

IDE Support

VSCode Extension and Language Server Protocol (LSP) support for custom function development.

bug_report

Debugger

Experimental debugger (mq-dbg) for inspecting and stepping through mq queries interactively.

widgets

External Subcommands

Extend mq with custom subcommands by placing executables starting with mq- in ~/.mq/bin/.

Try it Live

Run mq queries directly in your browser.

mq interactive Press Enter to run
1 query
mq>
2 markdown input
3 output LIVE