A macOS CLI that converts pasted text and TXT, Markdown, HTML, RTF, and DOCX files to plain text. Built with Go and Charmbracelet. All processing is local.
curl -fsSL https://raw.githubusercontent.com/michaelmjhhhh/declutter/main/install.sh | shInstalls to /usr/local/bin after verifying the release checksum. Supports Apple Silicon and Intel; Go is not required. Run again to update.
For a custom directory, append INSTALL_DIR="$HOME/.local/bin" before sh and add that directory to your PATH. To uninstall the default installation:
sudo rm /usr/local/bin/declutterdeclutter # Interactive mode
declutter -o clean.txt document.docx # Save to a new file
declutter -i notes.rtf # Preview a file
cat page.html | declutter > clean.txt # Pipe input
declutter --format markdown notes.txt # Override input format
declutter --helpIn interactive mode, choose Paste text or Open a file. Paste with Cmd+V, then press Ctrl+D to clean. For files, enter the path and press Enter.
| Key | Action |
|---|---|
C |
Copy |
S |
Save |
P |
Print and exit |
Ctrl+F |
Change input format |
↑ / ↓ |
Scroll |
N |
New conversion |
Esc |
Back |
Ctrl+C |
Quit |
Flags must precede the filename. Output preserves paragraphs, Unicode, and link addresses, using UTF-8 without a BOM. Preview wrapping is not included in copied or saved text. Existing files are never overwritten.
- Text input: UTF-8 or BOM-marked UTF-16, up to 32 MiB.
- TXT mode preserves literal
#and**; choose Markdown mode to remove markup. - DOCX extracts the main document only. RTF supports common body-text formatting.
- Table alignment and code indentation are removed. HTML scripts and CSS are not evaluated.
- PDF, legacy
.doc, and images are unsupported.
Requires Go 1.26.1 or later.
go build -o declutter .
go test -race ./...
go vet ./...
python3 scripts/test-install.pyBuild macOS release archives with sh scripts/build-release.sh v0.1.0.