> /tools/chomp
chomp
alphaTurn a web page, file or stdin into clean Markdown for LLMs: main content only, links absolute, code fenced.
Details
chomp fetches a URL, or reads a file or stdin, finds the main content and drops the rest: navigation, headers, footers, sidebars, cookie banners, ads, scripts and styles. What is left becomes Markdown with headings, lists, absolute links, fenced code blocks (with the language when the page says it) and tables.
It is one static binary with no browser and no runtime. It does not run JavaScript, so pages built only by scripts have nothing to extract.
Install and verify
Download the archive, check the minisign signature on SHA256SUMS, then the checksum, then unpack.
The archive holds the binary, its README and its license files.
The key is also at /minisign.pub.
# x86_64-unknown-linux-musl; for aarch64-unknown-linux-musl put that target in the file names instead B=https://crocbot.net/dl/chomp/0.1.2 curl -fsSO "$B/chomp-0.1.2-x86_64-unknown-linux-musl.tar.gz" -O "$B/SHA256SUMS" -O "$B/SHA256SUMS.minisig" minisign -Vm SHA256SUMS -P RWRSMj4Ps2C5uvNlvesTSmGGtyMounRPtQpqzEVG7+ryiL5TwCUnvd5v sha256sum -c --ignore-missing SHA256SUMS tar xzf chomp-0.1.2-x86_64-unknown-linux-musl.tar.gz && ./chomp-0.1.2-x86_64-unknown-linux-musl.d/chomp --version mkdir -p ~/.local/bin && install -m 755 chomp-0.1.2-x86_64-unknown-linux-musl.d/chomp ~/.local/bin/
Without minisign, sha256sum -c alone still catches corrupted downloads, but only the
signature proves the files came from crocbot.net. The last line copies chomp-0.1.2-x86_64-unknown-linux-musl.d/chomp to
~/.local/bin/; make sure that directory is on your PATH, or install it anywhere else you like.
Usage
chomp [OPTIONS] [URL|FILE|-]: reads an http(s):// URL, a file, or stdin (- or nothing). HTML, plain text, Markdown and JSON are accepted; images, PDFs and archives fail with exit 3.
Exit codes
0ok (an empty result still exits 0 and warns on stderr; try--raw)2usage3input: missing file, too large, binary content4network: DNS, TLS, timeout, HTTP status 400 or higher
Examples
# a page as Markdown
chomp https://crocbot.net/
# one JSON object, capped to fit a context window
chomp --json --max-chars 20000 https://en.wikipedia.org/wiki/Crocodile
# {"url", "title", "description", "lang", "canonical", "markdown",
# "links": [{"text", "url"}], "word_count", "truncated"}
# text only, no URLs (links[] in --json still has them)
chomp --no-links --no-images https://docs.python.org/3/library/json.html
# the whole page, no main-content guessing
chomp --raw https://news.ycombinator.com/
# HTML you already have: resolve relative links against its address
curl -s https://example.com/ | chomp --base-url https://example.com/
Limits and network
- UTF-8, plus Latin-1/Windows-1252 from the HTTP header or a
<meta charset>. - rustls with bundled Mozilla roots, gzip, up to 10 redirects (links resolve against the final URL).
--timeout(default 20 s) for the whole request,--max-bytes(default 10 MiB).--max-charsnever cuts through a fenced code block: a partial fence is dropped when there is content before it, or closed when the fence itself is the first block.- User-Agent:
chomp/VERSION (+https://crocbot.net/tools/chomp/).
Run chomp --help for every option.
Files for 0.1.2
| File | Kind | Target | Size | SHA-256 |
|---|---|---|---|---|
chomp-0.1.2-x86_64-unknown-linux-musl | binary | x86_64-unknown-linux-musl | 2.6 MiB | 4beb7349aaa4904970e8f266b3997bac35d4d5bdb5ca2fc6c2ac27fc4a3f858e |
chomp-0.1.2-aarch64-unknown-linux-musl | binary | aarch64-unknown-linux-musl | 2.0 MiB | 54d1f4ee2274c987232086d09256ed615e76e749983a54f6fae9f6a0e004bed2 |
chomp-0.1.2-x86_64-unknown-linux-musl.tar.gz | archive | x86_64-unknown-linux-musl | 1.2 MiB | cf94b5b7bfcceabc9d76c13db5c7c97359cbf4caff0baf07c70569159ce22a69 |
chomp-0.1.2-aarch64-unknown-linux-musl.tar.gz | archive | aarch64-unknown-linux-musl | 1.1 MiB | b1db1401769d7616d5f0a1b254a083f0d7b09cdb589ee062c4b6ae57f292f66f |
chomp-0.1.2-src.tar.gz | source | - | 133 KiB | b38e28e8f686464d01c4664d92051ccea35353dd38ae486fc341c4709a0b5504 |
SHA256SUMS | checksums | - | 521 B | 66d6680d6b4a022d67d3e0a9b3c982277895b30c62e9548d2d936de244174113 |
SHA256SUMS.minisig | signature | - | 318 B | 6dd143507fd982ef52018cea838eba6e9476ffe9bfeb41ba27b70f9df08de06b |