Clean Copy CLI — quick reference

One page. Every flag. Paste messy text, get clean output.

Install — see the dedicated Homebrew install guide
brew install mahope/clean-copy/clean-copy npm install -g github:mahope/clean-copy-cli

Or download binaries from GitHub releases.

📋 Basic usage

echo "<h1>Title</h1>" | clean-copy
clean-copy -i input.html -o output.md
cat article.html | clean-copy -m csv

⚡ Pipe from anywhere

# From a web page (curl + pipe)
curl -s https://example.com | clean-copy
# From clipboard (macOS)
pbpaste | clean-copy | pbcopy
# From clipboard (Linux)
xclip -o | clean-copy | xclip -i

Flags

FlagDescriptionDefault
-i, --input <file>Read from file instead of stdin
-o, --output <file>Write to file instead of stdout
-m, --mode <mode>Output format: markdown, wikilinks, csv, or textmarkdown
-v, --csvShorthand for --mode csv
-w, --wikilinksShorthand for --mode wikilinks
-s, --smartReplace smart quotes, em-dashes, non-breaking spacesoff
--versionPrint version
-h, --helpShow full help

Mode examples

Markdown (default)

echo '<strong>Done</strong>' | clean-copy
# → **Done**

Headings, links, lists, images, code blocks, tables all preserved.

WikiLinks

echo '<a href="/docs">Docs</a>' | clean-copy -w
# → [[Docs]]

Internal links → [[WikiLinks]]. External links stay as Markdown.

CSV

echo '<table><tr><td>A,B</td></tr></table>' | clean-copy -v
# → "A,B"

RFC 4180: commas and quotes inside cells are correctly escaped. colspan/rowspan handled.

Plain text

echo '<h1>Hello <em>world</em></h1>' | clean-copy -m text
# → Hello world

All markup stripped. Just readable characters.


🔧 Real-world pipeline

# Grab the main content of a page, clean it, save
curl -sL https://example.com/article \
  | clean-copy -m text -s \
  > article-clean.txt

# Table from a page straight to Excel
curl -sL https://example.com/prices \
  | clean-copy -v \
  > prices.csv

📡 Also available

Web tool — same engine in your browser, no install needed.
Browser extension — right-click → clean copy on any page.
Bookmarklet — no extension needed, works in any browser.
GitHub — source, issues, releases, npm install -g github:mahope/clean-copy-cli.

Try the web tool → GitHub repo