md is a small CLI for previewing Markdown locally. Point it at a file, save as
you work, and the browser stays in sync.
npm install -g @truyman/mdFor local development and releases, this repo follows the Bun CLI template conventions while still publishing a standard npm package.
- Live preview that reloads as you save your Markdown.
- GitHub Flavored Markdown support for tables, task lists, and strikethrough.
- Emoji shortcodes expand outside code blocks.
- GitHub-style callouts, tables, details, and themed code blocks with copy buttons.
- Mermaid diagrams render inline, include copy buttons, and adapt to the active theme.
- Built-in preview server with automatic light/dark theming.
- Repo-aware routing for relative Markdown links and assets, similar to GitHub's Markdown preview.
- Defaults to
README.mdwhen no file path is provided.
Preview README.md in the current directory:
mdPreview a specific file:
md OVERVIEW.mdWhen you run md, it will:
- Start a local preview server on an available port.
- Open your browser automatically.
- Serve your Git repo root from the local preview URL when possible.
- Re-render the active preview file whenever it changes.
Relative links resolve like they do on GitHub. If you run md from
docs/README.md, the browser opens /docs/README.md; links to other Markdown
files render in the preview, and links or HTML references to images and other
assets are served directly from the repo.
Install dependencies with Bun:
bun installCommon scripts:
bun run formatformats the repo withoxfmtand appliesoxlint --fix.bun run lintchecks formatting and lint rules without rewriting files.bun run typecheckruns TypeScript in Bun-oriented no-emit mode.bun testruns the Bun test suite.bun run buildbundles the CLI todist/.bun run verifyruns lint, typecheck, tests, and build.bun run releaseruns the release-it workflow and keepsCHANGELOG.mdupdated.
MIT