comark-cat
v0.1.2
Published
Simply render Markdown in your terminal with Comark.
Readme
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 | cmkThe 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 install --global comark-catpnpm add --global comark-catyarn global add comark-catbun add --global comark-catvp install --global comark-catRequires 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 -fRender 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 --streamOptional renderers can be disabled individually:
cmk README.md --no-highlight --no-math --no-mermaidAn explicit - selects stdin:
git show HEAD:README.md | cmk -Run cmk --help (or comark-cat --help) for all available options.
Development
See DEVELOPMENT.md.
