mdcat 3.2.1001

This package has a SemVer 2.0.0 package version: 3.2.1001+e80c28c016ed4bf43cdaa56b5b9a6a1bfdf603ca.
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global mdcat --version 3.2.1001
                    
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 3.2.1001
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=mdcat&version=3.2.1001
                    
nuke :add-package mdcat --version 3.2.1001
                    

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
3.6.1121 37 7/7/2026
3.5.1101 34 7/5/2026
3.5.1081 28 7/5/2026
3.5.1061 37 7/4/2026
3.4.1041 32 7/3/2026
3.4.1031 28 7/3/2026
3.3.1021 45 6/20/2026
3.2.1001 39 6/20/2026
3.1.981 41 6/19/2026
3.0.961 34 6/19/2026
2.18.951 38 6/19/2026
2.18.931 39 6/19/2026
2.18.911 36 6/19/2026
2.18.891 34 6/19/2026
2.18.871 36 6/19/2026