A CLI tool for converting various file formats to Markdown
mq-conv is a command-line tool that converts various file formats to Markdown. It supports 16+ formats including documents, spreadsheets, data formats, media files, and archives. Designed to work seamlessly with mq and other Markdown processing tools.
- Automatic Format Detection - Detects file formats by extension and magic bytes
- 16+ Supported Formats - Documents, data, media, and archives
- Stdin Support - Pipe data directly from other commands
- Modular Architecture - Enable only the formats you need via feature flags
curl -fsSL https://raw.githubusercontent.com/harehare/mq-conv/main/bin/install.sh | bashThe installer will:
- Download the latest release for your platform
- Verify the binary with SHA256 checksum
- Install to
~/.mq-conv/bin/ - Update your shell profile (bash, zsh, or fish)
After installation, restart your terminal or run:
source ~/.bashrc # or ~/.zshrc, or ~/.config/fish/config.fish# Install from crates.io
cargo install mq-conv
# Install using binstall
cargo binstall [email protected]git clone https://github.com/harehare/mq-conv.git
cd mq-conv
cargo build --release
# Binary will be at target/release/mq-conv# Convert a file to Markdown
mq-conv input.pdf
# Force a specific format
mq-conv input.bin --format json
# Pipe from stdin
cat input.json | mq-conv --format json# Convert a PDF and query headings
mq conv document.pdf | mq '.h'
# Convert Excel and filter content
mq conv data.xlsx | mq '.table'| Format | Extensions |
|---|---|
| Word | .docx |
| PowerPoint | .pptx |
.pdf |
|
| EPUB | .epub |
| HTML | .html |
| Format | Extensions |
|---|---|
| Excel | .xlsx, .xls, .xlsb, .ods |
| CSV | .csv, .tsv |
| Format | Extensions |
|---|---|
| JSON | .json |
| YAML | .yaml, .yml |
| TOML | .toml |
| XML | .xml |
| SQLite | .sqlite, .sqlite3, .db |
| Format | Extensions |
|---|---|
| Image | .png, .jpg, .jpeg, .gif, .webp, .svg, .bmp, .tiff |
| Audio | .mp3, .wav, .flac, .ogg, .m4a, .aac, .wma |
| Video | .mp4, .mkv, .avi, .mov, .webm, .m4v, .wmv, .flv |
| Format | Extensions |
|---|---|
| ZIP | .zip |
| TAR | .tar, .tgz |
Usage: mq-conv [OPTIONS] [FILE]
Arguments:
[FILE] Input file path (reads from stdin if omitted)
Options:
-f, --format <FORMAT> Force a specific format instead of auto-detecting
-h, --help Print help
-V, --version Print version
excel, pdf, powerpoint, word, image, zip, epub, audio, csv, html, json, yaml, toml, xml, sqlite, tar, video
- mq - The underlying Markdown query processor
- mq-tui - Interactive terminal interface for mq
- mqlang.org - Documentation and language reference
Contributions are welcome! Please feel free to submit issues or pull requests.
MIT