mat-cli 0.1.0

Beautiful markdown rendering for the terminal
mat-cli-0.1.0 is not a library.

mat

A beautiful markdown renderer for the terminal, written in Rust.

Like bat is to cat, mat is to your markdown files — rendering them with syntax highlighting, colors, and Unicode decorations right in your terminal.

Inspired by render-markdown.nvim, but for the CLI.

Features

  • Headings with colored prefixes and level indicators
  • Code blocks with syntax highlighting (via syntect), language labels, and box-drawing borders
  • Inline code with distinct background styling
  • Tables with Unicode box-drawing characters (┌─┬─┐) and column alignment
  • Lists with cycling bullet symbols (, , , ) and ordered numbering
  • Task lists with / checkboxes
  • Blockquotes with colored bars and nesting support
  • GitHub alerts (NOTE, TIP, WARNING, IMPORTANT, CAUTION) with icons
  • Links with underlined text and dimmed URLs
  • Images with alt text and 🖼 icon
  • Bold, italic, strikethrough, and underline via ANSI
  • Horizontal rules as full-width lines
  • Auto-paging through less when output exceeds terminal height
  • Dark and light themes
  • Stdin support — pipe markdown from other commands

Installation

From source

git clone https://github.com/meekgeek/mat.git
cd mat
cargo install --path .

With cargo

cargo install mat-cli

Usage

# Render a markdown file
mat README.md

# Render multiple files
mat file1.md file2.md

# Pipe from stdin
echo '# Hello' | mat
cat notes.md | mat

# Use light theme
mat -t light README.md

# Disable paging
mat --paging never README.md

# Plain output (no colors/decorations)
mat --plain README.md

# Set custom width
mat -w 100 README.md

Options

mat [OPTIONS] [FILE]...

Arguments:
  [FILE]...  Files to display. Use "-" for stdin.

Options:
  -t, --theme <THEME>    Color theme [default: dark] [possible: dark, light]
  -p, --plain            Plain output with no colors or decorations
      --paging <MODE>    When to use the pager [default: auto] [possible: auto, always, never]
      --pager <CMD>      Pager command [env: MAT_PAGER]
  -w, --width <COLS>     Wrap width in columns, 0 = terminal width [default: 0]
      --no-highlight     Disable syntax highlighting in code blocks
  -h, --help             Print help
  -V, --version          Print version

Paging

By default, mat pipes output through less -RFX when it exceeds your terminal height (same behavior as bat and git). Control this with:

  • --paging auto — page only when needed (default)
  • --paging always — always use the pager
  • --paging never — write directly to stdout

Override the pager command with --pager, the MAT_PAGER environment variable, or the standard PAGER variable.

Themes

mat ships with two built-in themes:

  • dark (default) — optimized for dark terminal backgrounds
  • light — optimized for light terminal backgrounds

License

MIT