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
| Flag | Description | Default |
|---|---|---|
-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 text | markdown |
-v, --csv | Shorthand for --mode csv | — |
-w, --wikilinks | Shorthand for --mode wikilinks | — |
-s, --smart | Replace smart quotes, em-dashes, non-breaking spaces | off |
--version | Print version | — |
-h, --help | Show 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.