mant
mant is ManT's complete native document command: an interactive terminal
reader for people, a deterministic structured CLI for scripts and agents, and
a read-only stdio MCP server. Every surface consumes the same normalized
document model.
Install
Download a supported prebuilt GitHub Release through
cargo-binstall:
Or compile from crates.io:
Source builds require Rust 1.88+ and a C compiler. Linux and macOS additionally require zlib development headers; Windows uses the checked MSVC memory-parser configuration without a system zlib.
| Target | Prebuilt archive | Source capabilities |
|---|---|---|
| Linux x64, glibc | Yes | Markdown and native man/mdoc |
| Linux arm64, glibc | Yes | Markdown and native man/mdoc |
| Windows x64, MSVC | Yes | Markdown and native man/mdoc |
| macOS | Source build | Markdown and native man/mdoc |
Targets without a matching archive fall back from cargo binstall to a Cargo
source build. Public macOS archives remain disabled until they can be signed
and notarized.
Interactive reader
An ordinary complete query opens the reader when standard input and output are
terminals. Use --ui to require it explicitly:
The reader provides a resizable outline, collapsible sections, semantic option nodes, settled-scroll following, page-local links, full-document search, keyboard and mouse input, and optional tldr quick references before the full document. Redirected output stays deterministic instead of emitting terminal control sequences.
Structured queries for agents and scripts
Discover the document before selecting only the content that matters:
Output formats include Markdown, text, and JSON. A complete native roff manual
also supports --format man for manual-only plain text without tldr content.
Search results carry reusable outline selectors and exact generated-Markdown
coordinates. Machine consumers can discover the authoritative contracts from
the installed executable:
mant --mcp exposes the same read-only document discovery, outline, excerpt,
explanation, and search capabilities over stdio JSON-RPC. MCP stdout contains
protocol messages only; use CLI JSON output to inspect lowering diagnostics.
Document sources
On Linux, macOS, and Windows, ManT indexes raw, gzip, and zstd manual sources and parses
their roff through bundled libmandoc. It does not require a system man or
mandoc executable at runtime. Windows defaults to
%USERPROFILE%\.local\share\man and also honors configured manual paths.
Reusable Markdown documents can be registered by filename below:
- Linux:
${XDG_DATA_HOME:-$HOME/.local/share}/mant/documents - macOS:
~/Library/Application Support/ManT/documents - Windows:
%APPDATA%\ManT\documents
Only immediate regular Markdown files are discovered; nested directories and
symlinks are ignored. Git or direct archive sources configured in sibling
sources.toml can be installed with mant --update-docs and selected with
--source. Removed source tables are reported as orphaned installed data;
preview cleanup with mant --prune-docs --dry-run and apply it with
mant --prune-docs. An unqualified name resolves root documents, sources by
descending priority and ascending source name, then a native manual. See the
complete document-source guide.
When compatible local tldr data exists, ManT prepends it as reserved outline
node 0. Reads prefer installed-client caches and then ManT's private cache;
mant --update-tldr updates through an installed client or the private
checkout.
Crate architecture
mant-astdefines the versioned document and query contracts.libmandoc-rsowns the cross-platform libmandoc parser boundary.mant-sourcesowns local Markdown discovery and optional source updates.mant-coreperforms document lookup, lowering, projections, search, and output.mant-uiprovides the source-neutral Ratatui frontend.mantowns command-line, terminal-selection, and MCP process boundaries.
The complete user manual, protocol reference, and release archives live in the ManT repository.
License
Apache-2.0. Native builds also contain the separately attributed upstream
mandoc sources distributed by libmandoc-rs.