# Marketplace CLI

A command line for an AI agent that finds the cheapest offers, other sellers, similar items, specs and review statistics on two Belarus marketplaces, with prices in the local currency and delivery to the capital. Every call prints one JSON envelope with a single error table, and shop data is read through a real browser.

- **Facts:** 2026, Personal project, Completed, role: Sole developer
- **What I did:** I wrote the whole command line alone, for my own daily use with an AI agent.
- **Scope:** backend
- **Domain:** developer-tools
- **Stack:** TypeScript, Bun, Playwright, Web scraping, Claude Code, pnpm
- **Page:** https://sergey-petrinich.vercel.app/work/marketplace-cli

Capabilities:

- Cheapest offers from both marketplaces searched in parallel, with filters and a funnel of what each one removed
- Other sellers of the same product and similar items
- Card details, variants and full specs for several products at once
- Review statistics for chosen products or for the top results of an earlier search
- One JSON envelope per call, for success and failure alike
- A single error table of 15 codes with a person-needed flag, retry flag, user message and agent instruction
- Time budget that ends before the caller's limit, with a list of what remains to re-run
- Exit codes ordered so that a site needing the user outranks a partial result
- Pages read from a persistent real browser profile per shop, with recovery when a page does not answer
- Score from price, review-weighted rating and review count, returned with its parts
- Review reading with an exact or estimated low-star share and a defect-word count
- 50+ tests on captured shop replies, and a doctor command that checks both shops, the delivery city and the hidden window

Back to the [work archive](https://sergey-petrinich.vercel.app/work.md) · [CV](https://sergey-petrinich.vercel.app/cv.md) · [all of it in one file](https://sergey-petrinich.vercel.app/llms-full.txt)
