[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-84018":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":36,"readmeContent":37,"aiSummary":9,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},84018,"mq","harehare\u002Fmq","harehare","A jq-like Markdown query language for command-line processing",null,"https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq","Rust",856,13,3,12,0,103,120,326,7.44,false,"main",[24,25,26,27,28,29,30,31,32,33,34,35],"cli","jq","markdown","rust","repl","md","query","mcp","tui","interpreter","language-server","scripting-language","2026-06-12 02:04:37","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"assets\u002Flogo.svg\" style=\"width: 128px; height: 128px;\"\u002F>\n\n\u003Ca href=\"https:\u002F\u002Fmqlang.org\">Visit the site 🌐\u003C\u002Fa>\n—\n\u003Ca href=\"https:\u002F\u002Fmqlang.org\u002Fbook\">Read the book 📖\u003C\u002Fa>\n—\n\u003Ca href=\"https:\u002F\u002Fmqlang.org\u002Fplayground\">Playground 🎮\u003C\u002Fa>\n\n\u003Ch1>mq\u003C\u002Fh1>\n\n[![ci](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fharehare\u002Fmq\u002Fci.yml?logo=github-actions&label=ci)](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Factions\u002Fworkflows\u002Fci.yml)\n[![audit](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fharehare\u002Fmq\u002Faudit.yml?logo=github-actions&label=audit)](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Factions\u002Fworkflows\u002Faudit.yml)\n[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fmq-markdown?logo=rust)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fmq-markdown)\n[![codecov](https:\u002F\u002Fimg.shields.io\u002Fcodecov\u002Fc\u002Fgithub\u002Fharehare\u002Fmq?logo=codecov)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fharehare\u002Fmq)\n[![codspeed badge](https:\u002F\u002Fimg.shields.io\u002Fendpoint?url=https:\u002F\u002Fcodspeed.io\u002Fbadge.json?style=for-the-badge)](https:\u002F\u002Fcodspeed.io\u002Fharehare\u002Fmq)\n\n**Query. Filter. Transform Markdown.**\n\nmq is a command-line tool that processes Markdown using a syntax similar to jq.\n\nIt's written in Rust, allowing you to easily slice, filter, map, and transform structured data.\n\n\u003C\u002Fdiv>\n\n![demo](assets\u002Fdemo.gif)\n\n> [!IMPORTANT]\n> This project is under active development.\n\n## Why mq?\n\nmq makes working with Markdown files as easy as jq makes working with JSON. It's especially useful for:\n\n- **LLM Workflows**: Efficiently manipulate and process Markdown used in LLM prompts and outputs\n- **LLM Input Generation**: Generate structured Markdown content optimized for LLM consumption, since Markdown serves as the primary input format for most language models\n- **Documentation Management**: Extract, transform, and organize content across multiple documentation files\n- **Content Analysis**: Quickly extract specific sections or patterns from Markdown documents\n- **Batch Processing**: Apply consistent transformations across multiple Markdown files\n\nSince LLM inputs are primarily in Markdown format, mq provides efficient tools for generating and processing the structured Markdown content that LLMs require.\n\n## Features\n\n- **Slice and Filter**: Extract specific parts of your Markdown documents with ease.\n- **Map and Transform**: Apply transformations to your Markdown content.\n- **Command-line Interface**: Simple and intuitive CLI for quick operations.\n- **Extensibility**: Easily extendable with custom functions.\n- **Built-in support**: Filter and transform content with many built-in functions and selectors.\n- **REPL Support**: Interactive command-line REPL for testing and experimenting.\n- **IDE Support**: VSCode Extension and Language Server **Protocol** (LSP) support for custom function development.\n- **Debugger**: Includes an experimental debugger (`mq-dbg`) for inspecting and stepping through mq queries interactively.\n- **External Subcommands**: Extend mq with custom subcommands by placing executable files starting with `mq-` in `~\u002F.local\u002Fbin\u002F`.\n\n## Installation\n\n### Quick Install\n\n```bash\ncurl -sSL https:\u002F\u002Fmqlang.org\u002Finstall.sh | bash\n```\n\nThe installer will:\n\n- Download the latest mq binary for your platform\n- Install it to `~\u002F.local\u002Fbin\u002F`\n- Update your shell profile to add mq to your PATH\n\n### Cargo\n\n```sh\n# Install from crates.io\ncargo install mq-run\n# Install from Github\ncargo install --git https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq.git mq-run --tag v0.6.0\n# Latest Development Version\ncargo install --git https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq.git mq-run --bin mq\n# Install the debugger\ncargo install --git https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq.git mq-run --bin mq-dbg --features=\"debugger\"\n# Install using binstall\ncargo binstall mq-run@0.6.0\n```\n\n### Binaries\n\nYou can download pre-built binaries from the [GitHub releases page](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Freleases):\n\n```sh\n# macOS (Apple Silicon)\ncurl -L https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Freleases\u002Fdownload\u002Fv0.6.0\u002Fmq-aarch64-apple-darwin -o \u002Fusr\u002Flocal\u002Fbin\u002Fmq && chmod +x \u002Fusr\u002Flocal\u002Fbin\u002Fmq\n# Linux x86_64\ncurl -L https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Freleases\u002Fdownload\u002Fv0.6.0\u002Fmq-x86_64-unknown-linux-gnu -o \u002Fusr\u002Flocal\u002Fbin\u002Fmq && chmod +x \u002Fusr\u002Flocal\u002Fbin\u002Fmq\n# Linux arm64\ncurl -L https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Freleases\u002Fdownload\u002Fv0.6.0\u002Fmq-aarch64-unknown-linux-gnu -o \u002Fusr\u002Flocal\u002Fbin\u002Fmq && chmod +x \u002Fusr\u002Flocal\u002Fbin\u002Fmq\n# Windows (PowerShell)\nInvoke-WebRequest -Uri https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Freleases\u002Fdownload\u002Fv0.6.0\u002Fmq-x86_64-pc-windows-msvc.exe -OutFile \"$env:USERPROFILE\\bin\\mq.exe\"\n```\n\n### Homebrew\n\n```sh\n# Using Homebrew (macOS and Linux)\nbrew install mq\n```\n\n### Arch\n\n```sh\n# Using yay (ArchLinux)\nyay -S mq-bin\n```\n\n### Docker\n\n```sh\n$ docker run --rm ghcr.io\u002Fharehare\u002Fmq:0.6.0\n```\n\n### Visual Studio Code Extension\n\nYou can install the VSCode extension from the [Visual Studio Marketplace](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=harehare.vscode-mq).\n\nFor VS Code compatible editors, it is also available on the [Open VSX Registry](https:\u002F\u002Fopen-vsx.org\u002Fextension\u002Fharehare\u002Fvscode-mq).\n\n### Neovim\n\nYou can install the Neovim plugin by following the instructions in the [mq.nvim README](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Fblob\u002Fmain\u002Feditors\u002Fneovim\u002FREADME.md).\n\n### Zed\n\nYou can install the Zed extension from the [harehare\u002Fzed-mq](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fzed-mq) repository.\n\n### GitHub Actions\n\nYou can use mq in your GitHub Actions workflows with the [Setup mq](https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fsetup-mq) action:\n\n```yaml\nsteps:\n  - uses: actions\u002Fcheckout@v6\n  - uses: harehare\u002Fsetup-mq@v1\n  - run: mq '.code' README.md\n```\n\n## Web\n\n### Playground\n\nThe [Playground](https:\u002F\u002Fmqlang.org\u002Fplayground) lets you run mq queries in the browser with no install.\n\n### mq-web (npm)\n\n[mq-web](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmq-web) is the official WebAssembly build for browser.\n\n## Language Bindings\n\nLanguage bindings are available for Elixir, Python, Ruby, Java, and Go. See the [Language Bindings documentation](https:\u002F\u002Fmqlang.org\u002Fbook\u002Fstart\u002Flanguage_bindings.html) for details.\n\n## Usage\n\nFor more detailed usage and examples, refer to the [documentation](https:\u002F\u002Fmqlang.org\u002Fbook\u002F).\n\nFor a comprehensive collection of practical examples, see the [Example Guide](https:\u002F\u002Fmqlang.org\u002Fbook\u002Fstart\u002Fexample\u002F).\n\n### Basic usage\n\n\u003Cdetails>\n\u003Csummary>Complete list of options (click to show)\u003C\u002Fsummary>\n\n```sh\nUsage: mq [OPTIONS] [QUERY OR FILE] [FILES]... [COMMAND]\n\nCommands:\n  repl  Start a REPL session for interactive query execution\n  help  Print this message or the help of the given subcommand(s)\n\nArguments:\n  [QUERY OR FILE]  \n  [FILES]...       \n\nOptions:\n  -A, --aggregate\n          Aggregate all input files\u002Fcontent into a single array\n  -f, --from-file\n          load filter from the file\n  -I, --input-format \u003CINPUT_FORMAT>\n          Set input format [possible values: markdown, mdx, html, text, null, raw, bytes, cbor, csv, hcl, json, psv, toml, toon, tsv, xml, yaml]\n  -L, --directory \u003CMODULE_DIRECTORIES>\n          Search modules from the directory\n  -M, --module-names \u003CMODULE_NAMES>\n          Load additional modules from specified files\n  -m, --import-module-names \u003CIMPORT_MODULE_NAMES>\n          Import modules by name, making them available as `name::fn()` in queries\n      --args \u003CNAME> \u003CVALUE>\n          Sets a named string argument. NAME is accessible directly in queries, and also via ARGS.\"named\" when --args or --argv is given\n      --rawfile \u003CNAME> \u003CFILE>\n          Sets file contents that can be referenced at runtime\n      --stream\n          Enable streaming mode for processing large files line by line\n  -F, --output-format \u003COUTPUT_FORMAT>\n          Set output format [default: markdown] [possible values: markdown, html, text, json, table, grep, raw, none]\n  -U, --update\n          Update the input markdown (aliases: -i, --in-place, --inplace)\n      --unbuffered\n          Unbuffered output\n      --list-style \u003CLIST_STYLE>\n          Set the list style for markdown output [default: dash] [possible values: dash, plus, star]\n      --link-title-style \u003CLINK_TITLE_STYLE>\n          Set the link title surround style for markdown output [default: double] [possible values: double, single, paren]\n      --link-url-style \u003CLINK_URL_STYLE>\n          Set the link URL surround style for markdown links [default: none] [possible values: none, angle]\n  -S, --separator \u003CQUERY>\n          Specify a query to insert between files as a separator\n  -o, --output \u003CFILE>\n          Output to the specified file\n  -C, --color-output\n          Colorize markdown output\n  -B, --before-context \u003CNUM>\n          Show NUM nodes before each match. Only effective with -F grep\n      --after-context \u003CNUM>\n          Show NUM nodes after each match. Only effective with -F grep\n      --context \u003CNUM>\n          Show NUM nodes before and after each match. Only effective with -F grep\n      --list\n          List all available subcommands (built-in and external)\n      --doc\n          Use the built-in reference document as input instead of a file\n  -P \u003CPARALLEL_THRESHOLD>\n          Number of files to process before switching to parallel processing [default: 10]\n      --argv [\u003CARGV>...]\n          Positional string arguments, available as ARGS.\"positional\" in queries\n  -O, --optimize-level \u003COPTIMIZE_LEVEL>\n          Optimization level for AST transformations (none = no changes, basic = constant folding and dead-branch elimination, full = all passes) [default: none] [possible values: none, basic, full]\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n\n# Examples\n\nmq 'query' file.md\nmq -f 'file' file.md        # read query from file\nmq repl                     # start a REPL session\n\n# Auto-parsing by file extension or -I flag\n\nmq automatically imports the matching module based on the file extension.\nUse -I \u003Cformat> to force a specific format:\n\n.cbor \u002F -I cbor  import \"cbor\" | cbor::cbor_parse()  (reads as bytes)\n.csv  \u002F -I csv   import \"csv\"  | csv::csv_parse(true)\n.hcl  \u002F -I hcl   import \"hcl\"  | hcl::hcl_parse()\n.json \u002F -I json  import \"json\" | json::json_parse()\n.psv  \u002F -I psv   import \"csv\"  | csv::psv_parse(true)\n.toml \u002F -I toml  import \"toml\" | toml::toml_parse()\n.toon \u002F -I toon  import \"toon\" | toon::toon_parse()\n.tsv  \u002F -I tsv   import \"csv\"  | csv::tsv_parse(true)\n.xml  \u002F -I xml   import \"xml\"  | xml::xml_parse()\n.yaml \u002F -I yaml  import \"yaml\" | yaml::yaml_parse()\n\nUse -I raw   to disable auto-parsing and receive the raw string.\nUse -I bytes to read input as raw bytes without parsing.\n\n# Passing arguments to queries (ARGS)\n\nWhen --args or --argv is given, ARGS = {\"positional\": [...], \"named\": {...}}\n\nmq -I null 'name' --args name Alice\nmq -I null 'ARGS | .\"named\"' --args name Alice\n# => {\"name\": \"Alice\"}\n\nmq -I null 'ARGS | .\"positional\"' --argv x y z  # must come after query and files\n# => [\"x\", \"y\", \"z\"]\n\nmq -I null 'ARGS' file.md --args name Alice --argv x y z\n# => {\"positional\": [\"x\",\"y\",\"z\"], \"named\": {\"name\": \"Alice\"}}\n```\n\n\u003C\u002Fdetails>\n\nHere's a basic example of how to use `mq`:\n\n```sh\n# Extract all headings from a document\nmq '.h' README.md\n\n# Extract only h1 headings\nmq '.h(1)' README.md\n\n# Extract h1 and h2 headings\nmq '.h(1, 2)' README.md\n\n# Extract headings from level 1 to 3 using a range\nmq '.h(1..3)' README.md\n\n# Extract only Rust code blocks\nmq '.code(\"rust\")' example.md\n\n# Extract code blocks containing \"name\"\nmq '.code | select(contains(\"name\"))' example.md\n\n# Extract code values from code blocks\nmq -A 'pluck(.code.value)' example.md\n\n# Extract language names from code blocks\nmq '.code.lang' documentation.md\n\n# Extract URLs from all links\nmq '.link.url' README.md\n\n# Filter table cells containing \"name\"\nmq '.[][] | select(contains(\"name\"))' data.md\n\n# Select lists or headers containing \"name\"\nmq 'select(.[] || .h) | select(contains(\"name\"))' docs.md\n\n# Exclude JavaScript code blocks\nmq '.code | select(.code.lang != \"js\")' examples.md\n\n# Convert CSV to markdown table\nmq 'include \"csv\" | csv_parse(true) | csv_to_markdown_table()' example.csv\n\n# Extract a section by title\nmq -A 'section::section(\"Installation\")' README.md\n\n# Filter sections by heading level (scalar or range)\nmq -A 'section::sections() | section::by_level(2)' README.md\nmq -A 'section::sections() | section::by_level(1..2)' README.md\n```\n\n### Composing Workflows with Subcommands\n\n`mq` subcommands are designed to work together via Unix pipes.\n\n```sh\n# Convert Excel report to Markdown, then extract all headings\nmq conv report.xlsx | mq '.h'\n\n# Convert a Word document and extract a specific section\nmq conv document.docx | mq -A 'section::section(\"Summary\")'\n\n# Convert and view Markdown directly in the terminal\nmq conv slides.pdf | mq view\n```\n\nRun `mq --list` to see all available subcommands (built-in and external).\n\n## External Subcommands\n\nYou can extend `mq` with custom subcommands by placing executable files starting with `mq-` in `~\u002F.local\u002Fbin\u002F` or anywhere in your `PATH`.\nThis makes it easy to add your own tools and workflows to `mq` without modifying the core binary.\n\nSee the [External Subcommands documentation](https:\u002F\u002Fmqlang.org\u002Fbook\u002Fstart\u002Fexternal_subcommands) for the full list and details.\n\n## Support\n\n- 🐛 [Report bugs](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Fissues)\n- 💡 [Request features](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq\u002Fissues)\n- ⭐ [Star the project](https:\u002F\u002Fgithub.com\u002Fharehare\u002Fmq) if you find it useful!\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n",2,"2026-06-11 04:12:06","trending"]