Echo/Docs

CLI command

competitors releases

The competitor release monitor: a competitor's changelog captured daily, each dated heading stored once as a release.

Invocation#

Shell
echo-cli competitors releases watch --url <changelog https-url> --competitor <name> --pattern <regex with (?<date>…)> --by <name>
echo-cli competitors releases watched
echo-cli competitors releases check [--url <changelog https-url>] --by <name>
echo-cli competitors releases list --url <changelog https-url>
echo-cli competitors releases unwatch --url <changelog https-url>

Inputs and output#

watch and unwatch write the watch (url, competitor, entry_pattern, created_by, created_at); watched writes every watch by competitor. check writes checks, one per changelog checked: url, competitor, capture_id, fetch_error (the error that stopped the capture, or null), unparsed (true when a readable capture has no heading the pattern matches) and new_releases. list writes the changelog's releases, newest first: id, url, heading, released_on, capture_id and first_seen_at.

State effect#

Every verb calls Echo Web's authenticated /api/market/releases with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the Competitor releases section of the competitors screen and of Echo Desktop's GEO screen call the same operation, echo-mcp reads watches and releases as echo_competitor_releases, and /api/cron/competitor-releases checks every watch daily. A check captures the page through Weles as competitors capture does, keeping the capture. Each heading of a readable capture that --pattern matches, with a date group Date.parse reads, is a release, stored once per changelog and heading in competitor_releases with that date and the capture it was first seen in. The pattern is the operator's, because each changelog writes its entries its own way; a readable capture none of whose headings match is answered as unparsed rather than as no releases.

Refusals#

  • A wrong invocation is refused before anything is sent: "competitors releases takes <every verb's usage, separated by semicolons>; got <word>", "competitors releases <verb> does not take <flag>; it takes …", "<flag> needs a value" and "competitors releases <verb> needs <flag>".
  • Echo Web answers a bad request with "url is required: the public https page to capture", "url must be an absolute https address; got <value>", "competitor is required: …", "entry_pattern is required: …", "entry_pattern is not a regular expression: <cause>" or "entry_pattern must name the date of an entry with a (?<date>…) group"; not found with "<url> is not watched; …"; and a conflict with "<url> is already watched as <competitor>'s changelog; unwatch it first". The command prints Echo Web's sentence and exits 1.