Skip to content

CLI Reference

tsx http-status-monitor.mts [options]

Options

FlagTypeDefaultDescription
--urls-file <path>string./urls.txtFile with one URL per line
--urls <url,...>stringInline comma-separated URLs. Takes precedence over --urls-file.
--lychee-path <path>stringautoExplicit path to lychee binary. Falls back to ./lychee-x86_64-unknown-linux-musl/lychee then PATH.
--verbose, -vflagoffShow lychee stderr and print results for unchanged URLs too
--diffflagoffPrint a unified diff when a URL's hash changes
--onceflagoffRun once and exit. Without this, the tool loops indefinitely.
--interval <secs>integer3600Sleep duration between runs in watch mode
--wait <secs>integer1Delay between consecutive URL checks within a single run
--victoriametricsflagoffAppend per-URL metrics to ./data/victoriametrics/[yyyy-mm]/results.jsonl

URL input

--urls takes precedence over --urls-file. Both accept any URL lychee can handle (https only — the tool passes --scheme https to lychee).

sh
# File input
tsx http-status-monitor.mts --once --urls-file ./urls.txt

# Inline
tsx http-status-monitor.mts --once --urls "https://example.com/,https://blog.example.com/"

lychee binary resolution

The tool searches in this order:

  1. --lychee-path if provided
  2. ./lychee-x86_64-unknown-linux-musl/lychee
  3. lychee on PATH

Throws if none found.

Exit codes

CodeMeaning
0Completed without crash (changes detected is not an error)
1Fatal error (lychee not found, unreadable URL file, etc.)

Individual URL errors (lychee finding 404s, timeouts) are logged but do not cause a non-zero exit.

State files

Snapshots are stored at ./data/state/<sha256-of-url-16-chars>.json. Each file contains the normalized canonical JSON from the last lychee run for that URL.

Output format

Each line printed to stdout follows this format:

[STATUS ] <url>  <hash-prefix-12>

STATUS is one of:

  • NEW — no previous snapshot exists
  • ok — hash matches previous run (only printed with --verbose)
  • CHANGED — hash differs from previous run

Released under the Apache 2.0 License.