slack-copy
v1.2.0
Published
Convert Markdown to Slack mrkdwn and put it on the clipboard
Downloads
656
Maintainers
Readme
slack-copy
Markdown on the clipboard, ready to paste into Slack.
Requirements
- macOS (the clipboard write goes through
osascript; with--no-copythe converter prints on any platform) - Node.js 18+
Install
From npm:
npx slack-copy message.md
# or
npm install -g slack-copyPre-publish, run it straight from GitHub:
npx github:finnjanssens/slack-copy message.mdOr as an Agent Skill for Claude Code, Cursor, Codex, opencode, or any other agent the skills CLI supports:
npx skills add finnjanssens/slack-copy -g # every detected agent
npx skills add finnjanssens/slack-copy -g -a claude-code # one agentOr manually:
git clone https://github.com/finnjanssens/slack-copy.git
ln -s "$(pwd)/slack-copy" ~/.claude/skills/slack-copySee SKILL.md for the skill instructions.
Slack's default composer is rich text: the one with the B I U toolbar. It
does not interpret mrkdwn, so pasting *bold* or <url|label> into it leaves
the asterisks, pipes and brackets sitting there literally. mrkdwn is only
interpreted for messages sent through the API, or when you turn on the "format
messages with markup" preference, which replaces the rich composer entirely.
So this puts two clipboard flavours down at once:
text/html— what the rich composer actually reads. Pasting produces real bold, lists, code and links, with no Slack setting involved.- plain text — mrkdwn, as a fallback for markup mode and for API posting.
Usage
npx slack-copy message.md # convert and copy
npx github:finnjanssens/slack-copy message.md # pre-publish, from GitHub
cat message.md | npx slack-copy
npx slack-copy --no-copy msg.md # print only
npx slack-copy --html msg.md # print the HTML it copiesReads a file argument or stdin. Prints the mrkdwn on stdout, since it is the
readable one to eyeball. macOS only: the clipboard write goes through
osascript, because pbcopy can only carry plain text.
Conversions
See references/conversions.md for the full Markdown → mrkdwn/HTML table.
Test
npm test # unit suite + eval rows
node evals/check.js # evals onlytest.ts is the unit suite; evals/ holds the data-driven evals: one row in
evals/cases.json pins one behaviour, and evals/check.js reports by row ID.
A new behaviour is a new row, and CI runs both on every PR.
