Convert anything to markdown. PDF, DOCX, PPTX, XLSX, HTML, EPUB, Jupyter notebooks, RSS, images, audio, URLs, Wikipedia, GitHub, iWork, XML, YAML, CSV, JSON, ZIP β everything gets milled.
bun run dev -- <file-or-url> # Dev β convert something
bun run dev -- convert <file-or-url> # Explicit convert command
bun run dev -- formats # List supported formats
bun run dev -- init # Create .markit/ config directory
bun run dev -- config show # Show configuration
bun run dev -- plugin install <src> # Install a plugin (npm:, git:, or path)
bun run dev -- plugin list # List installed plugins
bun test # Tests
bun run check # Biome lint + formatsrc/main.tsβ Commander entry point, global --json/--quiet/--prompt flagssrc/markit.tsβMarkitclass: converter registry. Tries converters in priority order.src/types.tsβ StreamInfo, ConversionResult, Converter, MarkitOptions interfacessrc/converters/β One file per format (20 converters: pdf, docx, pptx, xlsx, html, epub, ipynb, rss, image, audio, csv, json, xml, yaml, zip, github, wikipedia, iwork, plain-text)src/commands/β CLI commands (convert, formats, onboard, init, config, plugin)src/plugins/β Plugin system (install from npm/git/local, loader, API)src/utils/output.tsβ Chalk output helpers, triple output (json/quiet/human)
- Converter interface: Each converter implements
name,accepts(streamInfo), andconvert(buffer, streamInfo, options). OptionalconvertUrl()hook for URL-first converters (e.g. GitHub, Wikipedia). - Priority order: Specific formats first (pdf, docx), generic last (plain-text as catch-all)
- Output triple: Every command supports
--json,--quiet, and human-readable output - URL support:
markit https://example.comfetches and converts. Converters withconvertUrl()can handle fetching themselves. - LLM providers:
MarkitOptions.describefor image description,MarkitOptions.transcribefor audio transcription. Passed through via--prompt. - Plugin system: Extend with custom converters via
markit plugin install npm:pkg/git:url/ local path - Optional deps: xlsx is a dynamic import β fails gracefully with install instructions
- Create
src/converters/<format>.ts - Implement the
Converterinterface (name, accepts, convert) - Import and add to the converters array in
src/markit.ts - Add to the formats list in
src/commands/formats.ts