# Send LLM Markdown to chat channels without it breaking

> Send LLM-generated Markdown to Telegram, Slack and GitHub without it breaking — repaired, rendered for each channel and split within its limit, streaming included. Rust, npm (WASM), Go and a CLI.

HTML: https://minjun.kim/mdwire/

mdwire does not turn Markdown into finished output. It **tailors the Markdown an agent wrote to
each channel**: repaired, rewritten into the syntax that channel accepts, and split within its
length limit. Rendering is still the channel's job.

```
LLM markdown  →  normalize  →  render for channel  →  split safely  →  send
```

1. **Normalize.** Agent-written Markdown may not render correctly through a standard
   Markdown converter: unpaired `**`, emphasis that spans a line break in wrapped prose, unclosed
   code fences. Repair before rendering.
2. **Render.** Emit the syntax the channel accepts. Telegram HTML allows nine tags; Slack
   `markdown_text` takes standard Markdown directly.
3. **Split.** Respect the channel's limit and never cut through markup — including while
   streaming, where a chunk boundary must not land inside `**bold**`.

## Why another one

We found three gaps in existing tools: emphasis that spans lines, Korean notation that collides with
Markdown, and chat-channel converters that ignore streaming. [Why another one](https://minjun.kim/mdwire/why/) goes into each, and
[Cases](https://minjun.kim/mdwire/why/cases/) shows the real failures.

## Targets

Telegram HTML, Slack `markdown_text`, GitHub comments (GFM), Notion pages, plain
text, and HTML for the browser. A Rust core, a CLI, an npm package (WASM) and a Go implementation, all held to
the same test cases.

## Try it

The [demos](https://minjun.kim/mdwire/demo/) run the npm package in your browser.

- [Telegram vs. Slack](https://minjun.kim/mdwire/demo/channels/)\
  One agent answer rendered for Telegram and for Slack side by side.
- [Streaming](https://minjun.kim/mdwire/demo/streaming/)\
  The same answer streamed into five renderers.
- [Before and after repair](https://minjun.kim/mdwire/demo/repair/)\
  Broken agent output next to what mdwire sends.

## Install

```sh
npm install @minjun0219/mdwire     # npm — bundlers, Node, Bun
cargo add mdwire-core              # Rust library (`use mdwire::…`)
cargo install mdwire-cli           # the `mdwire` CLI
go get github.com/minjun0219/mdwire/go@latest
```

The [docs](https://minjun.kim/mdwire/docs/) cover the shared concepts and the API of each: [npm](https://minjun.kim/mdwire/docs/npm/),
[Rust](https://minjun.kim/mdwire/docs/rust/), [Go](https://minjun.kim/mdwire/docs/go/) and the [CLI](https://minjun.kim/mdwire/docs/cli/).
