Piping mq Subcommands Together
mq is a jq-like CLI for Markdown. Beyond its query engine, mq comes with a set of external subcommands:
| Subcommand | What it does |
|---|---|
mq conv |
Convert Excel, PDF, Word, HTML, etc. to Markdown |
mq edit |
Terminal-based Markdown editor |
mq view |
Markdown viewer |
mq task |
Markdown-based task runner |
mq tui |
Interactive TUI for trying queries |
They all work with stdin/stdout, so you can pipe them together.
A Few Examples
Pull headers out of an Excel file:
mq conv report.xlsx | mq edit | mq '.h'
Extract h2s from a Word doc and open them in the editor:
mq conv meeting-notes.docx | mq '.h2' | mq edit
Grab headings from a web page and view them:
curl -s https://mqlang.org | mq -I html 'select(.h1 || .h2)' | mq view
Merge multiple files with separators:
mq -A -S '"---"' 'identity' chapter1.md chapter2.md chapter3.md | mq view
Each subcommand has a single job:
mq conv → convert to Markdown
mq → query and transform
mq edit → edit
mq view → display
Custom Subcommands
Drop an executable named mq-* into ~/.mq/bin/ or your PATH, and it becomes a subcommand.
mq --list # see all available subcommands

Top comments (0)