3 Commits

Author SHA1 Message Date
f486150c06 Update upstream error classification to match current API client errors
The API client consolidates response decoding into a single code path
that produces "decoding response" errors instead of the previous
"decoding savings" / "decoding stores" / "reading response" variants.
Update classifyCLIError to match the current error strings, and add
"fetching savings" alongside the existing "fetching deals" / "fetching
stores" cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 01:31:55 -05:00
7dd963141a Add compare and tui commands with shared sort/filter CLI wiring
- add pubcli compare command to rank nearby stores by filtered deal coverage, bogo count, aggregate score, and distance tie-breaks
- support --count (1-10) for comparison breadth and emit structured JSON/text output with ranked entries
- add robust distance token parsing to tolerate upstream distance string formatting differences
- add pubcli tui interactive terminal browser with paging, deal detail drill-in, and explicit TTY validation for stdin/stdout
- share deal-filter flag registration across root/tui/compare and add --sort support in root execution path
- validate sort mode early and allow canonical aliases (end, expiry, expiration) while preserving explicit invalid-arg guidance
- expand tolerant CLI normalization for new commands/flags and aliases (orderby, sortby, count, bare-flag rewrite for compare/tui)
- update quick-start flag list and integration tests to cover compare help and normalization behavior
2026-02-23 00:27:18 -05:00
cca04bc11c Add CLI commands with structured errors and robot-mode behavior
Three cobra commands forming the CLI surface:
- root: fetch and filter weekly deals (--store/--zip with BOGO,
  category, department, query, and limit filters)
- stores: list nearby Publix locations by ZIP code
- categories: show available deal categories with counts

Structured error system with typed error codes (INVALID_ARGS,
NOT_FOUND, UPSTREAM_ERROR, INTERNAL_ERROR) and semantic exit codes
(0-4). Errors render as human-readable text or JSON depending on
output mode. Robot-mode features: auto-JSON when stdout is not a TTY,
compact quick-start help when invoked with no args, and JSON error
payloads for programmatic consumers.
2026-02-22 21:42:01 -05:00