← 全部工具

harehare/mq

热度 75 更新于 数据与数据库

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

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

<div align="center" <img src="assets/logo.svg" style="width: 128px; height: 128px;"/

<a href="https://mqlang.org"Visit the site 🌐</a — <a href="https://mqlang.org/book"Read the book 📖</a — <a href="https://mqlang.org/playground"Playground 🎮</a

<h1mq</h1

Query. Filter. Transform Markdown.

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.

</div

[!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

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