Skip to content

About

🙀Simply render Markdown in your terminal with Comark

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

comark-cat rendering Markdown in a terminal

Simply render Markdown in your terminal with Comark.

What is it?

comark-cat turns Markdown files and streams into polished terminal output. It ships in a compressed package under 700 KB while supporting syntax highlighting, tables, alerts, footnotes, and terminal-rendered Mermaid diagrams.

# Read a file
cmk README.md

# Read multiple files
cmk README.md DEVELOPMENT.md

# Read from stdin
git show HEAD:README.md | cmk

The package installs both cmk and comark-cat; they are equivalent, so use whichever name you prefer.

Features

  • Syntax-highlighted fenced code blocks powered by Rangi
  • Tables, task lists, alerts, footnotes, and emoji
  • Inline and block math powered by KaTeX
  • Mermaid diagrams rendered as terminal-friendly text
  • Terminal-aware colors, responsive width, and pager support

Huge thanks to @comark/ansi for powering most of these features 😻

Installation

npm
npm install --global comark-cat
pnpm
pnpm add --global comark-cat
Yarn
yarn global add comark-cat
Bun
bun add --global comark-cat
Vite Plus
vp install --global comark-cat

Requires Node.js 22 or newer.

The CLI

Set the output width, turn off colors, or open the result in your pager:

cmk README.md --width 100
cmk README.md --no-color
cmk README.md --pager
cmk README.md --frontmatter # or -f

Render piped Markdown incrementally as it arrives, for example from an LLM:

for chunk in '# Generating' '' 'Streaming **Markdown**...'; do printf '%s\n' "$chunk"; sleep 1; done | cmk --stream

Optional renderers can be disabled individually:

cmk README.md --no-highlight --no-math --no-mermaid

An explicit - selects stdin:

git show HEAD:README.md | cmk -

Run cmk --help (or comark-cat --help) for all available options.

Development

See DEVELOPMENT.md.

License

MIT

About

🙀Simply render Markdown in your terminal with Comark

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages