The defuddle CLI allows you to extract article content from a web URL, a local HTML file, or via stdin.
Commands
parse [source]
Parses HTML content from the provided source.
Arguments:
source: An HTML file path, a URL (starting with http:// or https://), or - to read from stdin.
Options:
-o, --output <file>: Specify the output file path. If omitted, results are printed to stdout.-m, --markdown or --md: Convert the extracted content to markdown format.-j, --json: Output the result as a JSON object containing metadata (title, description, domain, etc.) and content.-f, --frontmatter: Prepend YAML frontmatter (containing title, author, source, etc.) to the output.-p, --property <name>: Extract only a specific property from the result (e.g., title, description, domain, wordCount).--debug: Enable debug mode.-l, --lang <code ext>: Set the preferred language using BCP 47 codes (e.g., en, fr, ja).-u, --user-agent <string>: Provide a custom User-Agent header for HTTP requests to avoid 403/FORBIDDEN errors.
Examples
Parse a URL and output to a file as Markdown:
defuddle parse https://example.com -m -o article.md
Pipe HTML from stdin:
cat page.html | defuddle parse -
Extract only the title as JSON:
defuddle parse https://example.com --property title