Skip to content

CLI Reference

This page documents the html2rss command-line interface (CLI).

For detailed documentation on the Ruby API, please refer to the official YARD documentation.

📚 View the Ruby API Docs on rubydoc.info

The html2rss executable is the primary way to interact with the gem from your terminal.

Automatically discovers items from a page and prints the generated RSS feed to stdout.

Terminal window
# Use the default faraday strategy
html2rss auto https://example.com/articles
# Force browserless for JavaScript-heavy pages
html2rss auto https://example.com/app --strategy browserless
# Set custom request budgets
html2rss auto https://example.com/app --strategy browserless --max-redirects 5 --max-requests 6
# Hint the item selector while keeping auto enhancement
html2rss auto https://example.com/articles --items_selector ".post-card"

Command: html2rss auto URL

Loads a YAML config, builds the feed, and prints the RSS XML to stdout.

Terminal window
# Single-feed config
html2rss feed single.yml
# Multi-feed config under the `feeds:` key
html2rss feed feeds.yml my-first-feed
# Override the request strategy at runtime
html2rss feed single.yml --strategy browserless
# Override request budgets at runtime
html2rss feed single.yml --max-redirects 5 --max-requests 6
# Pass dynamic parameters into %<param>s placeholders
html2rss feed single.yml --params id:42 foo:bar

Command: html2rss feed YAML_FILE [feed_name]

The CLI keeps strategy as a top-level override and writes runtime request limits into the generated config under request.

Prints the exported JSON Schema for the current gem version.

Terminal window
# Pretty-printed JSON (default)
html2rss schema
# Compact JSON
html2rss schema --no-pretty
# Write the schema to a file
html2rss schema --write tmp/html2rss-config.schema.json

Command: html2rss schema

Validates a config with the runtime validator without generating a feed.

Terminal window
# Validate a single-feed file
html2rss validate single.yml
# Validate one feed from a multi-feed file
html2rss validate feeds.yml my-first-feed

Command: html2rss validate YAML_FILE [feed_name]

Displays the help message with available commands and options.

Command: html2rss help

Displays the installed version of html2rss.

Command: html2rss --version