Format Markdown and HTML to paste into Slack with styles preserved.
Slack handles simple formatting when you paste, but anything beyond that breaks — nested lists get flattened, links lose their labels, and code blocks fall apart. slackfmt converts your content to Slack's native rich text format so everything pastes correctly.
echo "**bold** and _italic_" | npx @slackfmt/cli@latest
cat doc.md | npx @slackfmt/cli@latest
npx @slackfmt/cli@latest -f html < page.htmlBy default, slackfmt copies the result to your clipboard ready to paste into Slack. Use --stdout to print to stdout instead.
Supported input formats (-f flag): markdown (default, auto-detected), html, slack-html, quill-delta.
Add slackfmt as a skill for Claude Code or other AI agents:
npx skills add https://github.com/cauethenorio/slackfmt --skill slackfmtOnce installed, just ask your agent to format something for Slack — it will compose the markdown content, pipe it through npx @slackfmt/cli@latest, and copy the result to your clipboard ready to paste.
Try it in the browser at slackfmt.labs.caue.dev.
Slack uses Quill Delta JSON as its compose bar internal rich text format. When you paste into Slack, it looks for a slack/texty entry inside a Chromium custom MIME type (org.chromium.web-custom-data) on the clipboard.
slackfmt exploits this by:
- Converting your input (Markdown, HTML, etc.) to Quill Delta JSON
- Encoding the Delta as a Chromium Pickle binary blob with the
slack/textyMIME type - Writing it to the system clipboard via a native Rust addon
When you paste, Slack reads the custom data and applies the formatting natively — bold, italic, nested lists, code blocks, links, and blockquotes all come through intact.
| Package | Description |
|---|---|
| @slackfmt/core | Conversion engine |
| @slackfmt/cli | Command-line interface |
| @slackfmt/clipboard | Native clipboard integration (Rust) |
| @slackfmt/web | Web interface |