harehare / mq
jq-like command-line tool for markdown processing
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing harehare/mq in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewVisit the site 🌐 — Read the book 📖 — Playground 🎮 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. > [!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 ( ) for inspecting and stepping through mq queries interactively. • **External Subcommands**: Extend mq with custom subcommands by placing executable files starting with in . Installation Quick Install The installer will: • Download the latest mq binary for your platform • Install it to • Update your shell profile to add mq to your PATH Cargo Binaries You can download pre-built binaries from the GitHub releases page: Homebrew Docker mq-lsp (Language Server) The mq Language Server provides IDE features like completion, hover, and diagnostics for mq query files. Quick Install Cargo Binaries You can download pre-built binaries from the GitHub releases page: Visual Studio Code Extension You can install the VSCode extension from the Visual Studio Marketplace. Neovim You can install the Neovim plugin by following the instructions in the mq.nvim README. Zed You can install the Zed extension by following the instructions in the zed-mq README. GitHub Actions You can use mq in your GitHub Actions workflows with the Setup mq action: Language Bindings Language bindings are available for the following programming languages: • mq_elixir • mq-python • mq-ruby • mq-java • mq-go Usage For more detailed usage and examples, refer to the documentation. For a comprehensive collection of practical examples, see the Example Guide. Basic usage Complete list of options (click to show) Here's a basic example of how to use : Advanced Usage You can chain multiple operations to perform complex transformations: Using with markitdown You can combine with markitdown for even more powerful Markdown processing workflows: External Subcommands You can extend with custom subcommands by placing executable files starting with in or anywhere in your . This makes it easy to add your own tools and workflows to without modifying the core binary. External Tools The following external tools are available to extend mq's functionality: • mq-check - A syntax and semantic checker for mq files. • mq-conv - A CLI tool for converting various file formats to Markdown. • mq-crawler - A web crawler that extracts structured data from websites and outputs it in Markdown format. • mq-docs - A documentation generator for mq functions, macros, and selectors. • mq-edit - A terminal-based Markdown and code editor with WYSIWYG rendering and LSP support. • mq-lsp - Language Server Protocol (LSP) implementation for mq query files, providing IDE features like completion, hover, and diagnostics. • mq-mcp - Model Context Protocol (MCP) server implementation for AI assistants • mq-task - Task runner using mq for Markdown-based task definitions • mq-tui - Terminal User Interface (TUI) for interactive mq query • mq-update - Update mq binary to the latest version • mq-view - viewer for Markdown content Support • 🐛 Report bugs • 💡 Request features • ⭐ Star the project if you find it useful! License This project is licensed under the MIT License. See the LICENSE file for details.