v0.9.0
--json-nodes — full node dumps for jq
pup's json{}, with a cleaner shape. Each match becomes one NDJSON object:
$ cull '.post h2 a' --json-nodes blog.html
{"tag":"a","attrs":{"href":"/posts/hello"},"text":"Hello, world","children":["Hello, world"]}attrsis its own object — pup inlines attributes next totag/text, so an attribute literally namedtagcollides; here it can'ttexton every node is the collapsed subtree text (layout-aware:<br>/block boundaries become spaces,script/styleexcluded)childreninterleaves child element objects with text-node strings — full structure, comments dropped- URL attributes (
href,src, …) respect-b/--base, and auto-resolve when the input is a fetched URL --arraymerges everything into one JSON array;-ppretty-prints — same as-j
It's also the escape hatch for raw <script> payloads, e.g. JSON-LD structured data:
$ cull 'script[type="application/ld+json"]' --json-nodes page.html \
| jq '.children[0] | fromjson | {name, datePublished}'When you'd rather name the fields up front and skip the jq pass, -j templates are still the short way: cull a -j '{url: . @href, text: .}'.
140 tests.
Install: brew install rashida-thorne/cull/cull · cargo binstall cull · scoop bucket add cull https://github.com/rashida-thorne/scoop-cull && scoop install cull · nix run github:rashida-thorne/cull · more options
Full changelog: https://github.com/rashida-thorne/cull/blob/main/CHANGELOG.md