CLI reference

Use the installed executable’s help for exact flags, positional arguments and defaults rather than a hand-maintained copy.

header --help
header extract --help
header card --help

Commands

CommandPurpose
extract (or default URL argument)Fetch and render website metadata
lint / verifyInspect metadata and URL validity
lint-rules / lint-rule-listsDiscover available lint rules and lists
trace-redirectsInspect HTTP and meta-refresh redirects
edit head / edit metaModify local HTML head elements
cardExport a shareable preview image
viewView linked images or icons
httprettyPrint HTTP request and response details

Output styles include default, all_fields, all_fields_plain, json, discord, jsonld, opengraph and twitter. Use header extract --help to check the current version.

Common HTTP Options

HTTP-backed commands support bounded retries for idempotent requests:

  • --retry-attempts: Total attempts for idempotent GET requests (default: 3; 1 disables retries).
  • --retry-delay: Initial delay between retries (default: 250ms).
  • --retry-max-delay: Maximum backoff delay cap (default: 5s).
  • --timeout: Maximum total request timeout (default: 20s).
  • --image-timeout: Image download timeout for image and card commands (default: 10s).

Retry policy automatically retries transient network errors and HTTP 408, 429, 500, 502, 503, and 504 responses, respecting Retry-After headers and context deadlines. Permanent 400, 401, 403, and 404 responses are not retried.

Go package APIs are documented at pkg.go.dev/github.com/arran4/header.