mq_run/lib.rs
1//! Command-line interface for the mq markdown processing tool.
2//!
3//! This crate provides the CLI implementation for mq, a jq-like tool for processing
4//! markdown files. It handles command-line argument parsing, input/output processing,
5//! and integration with the mq language engine.
6//!
7//! # Features
8//!
9//! - Process markdown, MDX, HTML, and plain text inputs
10//! - Support for file and stdin input
11//! - Multiple output formats
12//! - Optional debugger integration (with `debugger` feature)
13//! - Configuration file support
14//! - Interactive REPL mode
15//!
16//! # Usage
17//!
18//! The CLI is typically used through the `mq` binary, but can be embedded in other applications:
19//!
20//! ```rust,no_run
21//! use mq_run::Cli;
22//! use clap::Parser;
23//!
24//! let cli = Cli::parse();
25//! cli.run().expect("CLI execution failed");
26//! ```
27//!
28//! # Command-line Examples
29//!
30//! Process markdown from a file:
31//! ```bash
32//! mq '.h' input.md
33//! ```
34//!
35//! Filter headings from stdin:
36//! ```bash
37//! echo "# Title\nContent" | mq '.h | select(level == 1)'
38//! ```
39//!
40//! Use the REPL:
41//! ```bash
42//! mq --repl
43//! ```
44
45pub mod cli;
46pub(crate) mod grep;
47pub(crate) mod table;
48
49#[cfg(feature = "debugger")]
50pub mod debugger;
51
52pub use cli::Cli;