mdcat 4.27.1671

This package has a SemVer 2.0.0 package version: 4.27.1671+f8b1ebfd4158951924d38906671def88c15bdbc4.
dotnet tool install --global mdcat --version 4.27.1671
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local mdcat --version 4.27.1671
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=mdcat&version=4.27.1671
                    
nuke :add-package mdcat --version 4.27.1671
                    

mdcat

A tiny cat for Markdown. Reads a Markdown file (or stdin) and renders it to styled terminal output using Console.Lib's MarkdownRenderer — headings, bold/italic, inline code, lists, blockquotes, fenced code blocks, OSC 8 hyperlinks, and LaTeX math.

Usage

mdcat [options] [file]
Argument Meaning
file Markdown file to render. Use - for stdin. Omit to read redirected stdin, else show help.
Option Meaning
-h, --help Show help.
--mode <encoding> Display-math rendering: unicode | sixel | sextant | halfblock. Default: auto-detect via DA1 (sixel on capable terminals, sextant otherwise).
--color <mode> truecolor | 16 | none. Default: auto-detect.
--no-color, --plain Plain text, no escape sequences. Shorthand for --color none.
--width <N> Render width in columns. Default: console width, or 80.

Color auto-detection. With no --color, mdcat emits truecolor and, when it detects a 24-bit-capable terminal (COLORTERM=truecolor/24bit, or a known terminal via WT_SESSION / TERM_PROGRAM), switches to a richer GitHub-Dark palette; otherwise it uses the default 16-color-safe palette. An explicit --color overrides detection. NO_COLOR (see no-color.org) disables color unless --color overrides it.

Examples

mdcat README.md                  # render a file
cat README.md | mdcat -          # render from stdin
mdcat --mode unicode notes.md    # force Unicode math (no raster)
mdcat --plain README.md > out.txt # strip styling for plain capture

Exit codes

Code Meaning
0 Success (also --help).
1 I/O error — file not found or unreadable input.
2 Bad arguments.

Math

Display math rasterizes (sixel / sextant / half-block per --mode) only when the delimiters sit on their own lines — i.e. a block:

$$
\int_0^1 x^2\,dx = \frac{1}{3}
$$

Single-line $$...$$ and inline $...$ always render as single-row Unicode, never rastered.

Rastering needs an OpenType math font. mdcat bundles STIX Two Math (Fonts/STIX2Math.otf, SIL OFL — see Fonts/STIX2-OFL.txt) next to the executable, so math renders the same everywhere without relying on system fonts. If that file is ever missing, MarkdownRenderer falls back to an internal system-font search (STIX Two Math, Cambria Math, …) and, failing that, a Unicode-only approximation.

Images

An image that sits alone on its own line (![alt](path)) is rendered as a picture — Sixel on capable terminals, otherwise Unicode block characters (sextant / half-block), scaled to fit the render width. An image inside a line of text, or one that can't be displayed, renders as its alt text instead (the file name when the alt is empty).

![architecture diagram](docs/arch.png)

Supported formats: PNG and baseline JPEG (plus BMP / GIF / TGA), via a pure-managed decoder. Progressive JPEG, SVG and WebP are not supported and fall back to alt text.

No network support. mdcat does not download images. Only local files are read — relative paths resolve against the markdown file's directory (or the current directory when reading from stdin). Remote http(s):// and data: URLs are never fetched and render as their alt text. Add --no-color / --plain (or set NO_COLOR) to force every image to alt text.

Install

As a .NET global tool (needs the .NET 10 runtime)

dotnet tool install --global mdcat

Auto-updatable (dotnet tool update -g mdcat) and discoverable via dotnet tool search mdcat. The bundled math font ships inside the package, so display math works out of the box.

Prebuilt native binary (no runtime required)

Download a self-contained binary from the Releases page. Native AOT builds are published for:

OS x64 arm64
Linux linux-x64 linux-arm64
Windows win-x64 win-arm64
macOS osx-x64 osx-arm64

Each archive contains the mdcat executable plus the Fonts/ directory (the bundled math font must sit next to the binary). Extract it and put the folder on your PATH, e.g.:

tar -xzf mdcat-1.0.0-linux-x64.tar.gz
sudo cp -r mdcat-1.0.0-linux-x64/* /usr/local/bin/   # mdcat + Fonts/

Releases are cut by pushing a mdcat-vX.Y.Z tag, which runs .github/workflows/mdcat-release.yml.

Build from source

dotnet build src/MdCat                          # build
dotnet run --project src/MdCat -- README.md     # run in place

# native, self-contained binary for the current platform
dotnet publish src/MdCat -c Release -r <rid> --self-contained -o out
# (rid = linux-x64 | win-x64 | osx-arm64 | …; output in out/, with out/Fonts/)

# or install as a .NET global tool from a local package
dotnet pack src/MdCat -c Release
dotnet tool install --global --add-source src/MdCat/bin/Release mdcat
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
4.27.1671 30 8/22/2026
4.26.1661 27 8/20/2026
4.26.1651 33 8/16/2026
4.25.1641 38 8/14/2026
4.24.1631 38 8/14/2026
4.23.1611 34 8/12/2026
4.22.1601 31 8/11/2026
4.21.1591 33 8/11/2026
4.20.1581 36 8/9/2026
4.19.1571 28 8/8/2026
4.18.1561 31 8/8/2026
4.17.1551 40 8/8/2026
4.17.1541 38 8/4/2026
4.16.1521 37 8/4/2026
4.16.1511 21 8/4/2026
4.16.1501 29 8/4/2026
4.15.1491 41 8/3/2026
4.14.1481 35 8/2/2026
4.13.1471 40 8/2/2026
4.12.1461 43 8/2/2026
Loading failed