Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mq

> 前端框架
Open source

A jq-like Markdown query language for command-line processing

993 stars0 likes2 views
WebsiteGitHub

About

A jq-like Markdown query language for command-line processing

[!IMPORTANT] This project is under active development.

Why mq?

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

  • LLM Workflows: Efficiently manipulate and process Markdown used in LLM prompts and outputs
  • LLM Input Generation: Generate structured Markdown content optimized for LLM consumption, since Markdown serves as the primary input format for most language models
  • Documentation Management: Extract, transform, and organize content across multiple documentation files
  • Content Analysis: Quickly extract specific sections or patterns from Markdown documents
  • Batch Processing: Apply consistent transformations across multiple Markdown files

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

Features

  • Slice and Filter: Extract specific parts of your Markdown documents with ease.
  • Map and Transform: Apply transformations to your Markdown content.
  • Command-line Interface: Simple and intuitive CLI for quick operations.
  • Extensibility: Easily extendable with custom functions.
  • Built-in support: Filter and transform content with many built-in functions and selectors.
  • REPL Support: Interactive command-line REPL for testing and experimenting.
  • IDE Support: VSCode Extension and Language Server Protocol (LSP) support for custom function development.
  • Debugger: Includes an experimental debugger (mq-dbg) for inspecting and stepping through mq queries interactively.
  • External Subcommands: Extend mq with custom subcommands by placing executable files starting with mq- in ~/.local/bin/.

Installation

Quick Install

bash
curl -sSL https://mqlang.org/install.sh | bash

Downloads the latest mq binary for your platform, installs it to ~/.local/bin/, and updates your shell profile to add mq to your PATH.

Package Managers

Method Command
Homebrew (macOS/Linux) brew install mq
Arch (yay) yay -S mq-bin
Cargo (crates.io) cargo install mq-run
Docker docker run --rm ghcr.io/harehare/mq:latest

More install options: cargo variants, binstall, pre-built binaries

bash
# Install from Github
cargo install --git https://github.com/harehare/mq.git mq-run --tag v0.8.5
# Latest Development Version
cargo install --git https://github.com/harehare/mq.git mq-run --bin mq
# Install the debugger
cargo install --git https://github.com/harehare/mq.git mq-run --bin mq-dbg --features="debugger"
# Install using binstall
cargo binstall [email protected]

Pre-built binaries for macOS, Linux, and Windows are also available on the GitHub releases page.

Editor & CI Integrations

Integration Link
VS Code
Chrome
Neovim
Zed
JetBrains IDEs
Obsidian
Helix
GitHub Actions
yaml
steps:
  - uses: actions/checkout@v7
  - uses: harehare/setup-mq@v1
  - run: mq '.code' README.md

Packages

mq is a Rust + TypeScript monorepo.

Rust crates and npm packages (click to show)

Name Description Version
mq-run Command-line interface for mq
mq-lang Core language implementation
mq-markdown Markdown parsing and manipulation utilities
mq-lsp Language Server Protocol implementation
mq-repl Interactive REPL
mq-formatter Code formatter for the mq query language
mq-lint Static analysis linter
mq-check Type checker
mq-hir High-level Internal Representation (HIR)
mq-dap Debug Adapter Protocol implementation
mq-crawler Directory crawler for batch Markdown processing
mq-web-api HTTP/REST server exposing mq queries over the network
mq-macros Procedural macros for builtin function registration
mq-test Test runner for mq
mq-ffi C API for integrating mq into C applications —
mq-wasm WebAssembly bindings —
mq-web Official WebAssembly build for the browser
mq-nodejs Node.js bindings

mq is also available as a hosted REST API (see mq-web-api above). See the REST API docs or try it in the Playground.

bash
curl --data-binary @doc.md https://api.mqlang.org/.h1

Language Bindings

Language bindings are available for Elixir, Python, Ruby, Java, and Go. See the Language Bindings documentation for details.

Usage

For more detailed usage and examples, refer to the documentation.

Looking for a solution to a specific problem? See the Cookbook for task-first recipes, or the Example Guide for a full tour of mq's selectors and built-in functions.

Basic usage

Complete list of options (click to show)

…

Here's a basic example of how to use mq:

…

Composing Workflows with Subcommands

mq subcommands are designed to work together via Unix pipes.

bash
# Convert Excel report to Markdown, then extract all headings
mq conv report.xlsx | mq '.h'

# Convert a Word document and extract a specific section
mq conv document.docx | mq -A 'section::section("Summary")'

# Convert and view Markdown directly in the terminal
mq conv slides.pdf | mq view

Run mq --list to see all available subcommands (built-in and external).

External Subcommands

You can extend mq with custom subcommands by placing executable files starting with mq- in ~/.local/bin/ or anywhere in your PATH. This makes it easy to add your own tools and workflows to mq without modifying the core binary.

See the External Subcommands documentation for the full list and details.

Support

  • Report bugs
  • Request features
  • ⭐ Star the project if you find it useful!

Contributing

Contributions are welcome! See CONTRIBUTING.md for development setup, coding conventions, and how to submit changes. Please also review our Code of Conduct.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustclihtml-to-markdowninterpreterjq

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架