VOOZH about

URL: https://dev.to/ricardo_cuba/add-commerce-to-your-ai-agent-in-4-lines-3iab

⇱ Add Commerce to Your AI Agent in 4 Lines - DEV Community


4 commands. 38 retailers. 8 countries. Your agent just learned how to shop.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The problem
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

You're building an AI agent. It can search the web, reason about complex topics, generate code. But when it needs to answer a simple question like "how much does rice cost in Lima today?" — it hits a wall.

Not because it's dumb. Because every retailer has a different API, auth mechanism, schema, and checkout flow. There's no Stripe for commerce data.

Until now.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4 lines. That's it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

'''bash
# 1. Install
pip install cli-market-world

# 2. Guided first search + interactive tutorial
market init # login + first query
market tutorial # 3 exercises: search, compare, export — 60 seconds

# 3. Search — your agent just queried 38 retailers in <1s
market search "leche" --country PE --json

# 4. Connect to your AI agent via MCP
# Add to Cursor / Claude / any MCP client:
# → https://cli-market.dev/tools?utm_source=devto&utm_campaign=spike-jun09
'''

That's the entire integration. No API keys per retailer. No HTML scraping. No schema mapping.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What happens under the hood
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

When your agent runs market search "rice" --country PE --json, CLI Market:

  1. Normalizes the query — "arroz", "rice", "arroz blanco" all map to the same product
  2. Queries our collector — 38 active retailers, refreshed every 4 hours
  3. Returns structured JSON — price per kg/L, store name, country, timestamp
  4. Handles auth — one CLI Market token, not 38 retailer tokens

What it looks like in your terminal:

![CLI Market terminal output — 60 seconds, real prices]

'''json{"query":"arroz","country":"PE","results":[{"product":"Arroz Extra 5kg","price":18.90,"price_per_kg":3.78,"store":"Wong","country":"PE","refreshed_at":"2026-06-10T08:00:00Z"}]}'''

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MCP: the missing piece
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

CLI Market exposes 22 curated MCP tools (46 legacy) — search, compare, basket, checkout paths — so your agent can:

  • Search products across all retailers
  • Compare prices between stores
  • Filter by country, category, or price range
  • Get historical price data (Pro tier)

Connect in Cursor or any MCP client in 30 seconds. Configuration at cli-market.dev/tools.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What you can build with this
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  • Price monitoring agents — track commodity prices across LATAM
  • Shopping assistants — "find the cheapest 5kg rice in Lima"
  • Competitive intelligence — benchmark your retail prices against the market
  • Supply chain optimization — auto-reorder when prices drop below threshold

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What's next
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

We're working on cart + checkout — so your agent doesn't just search, it buys. One API call to add to cart across any supported retailer.

Start building:

'''bash
pip install cli-market-world
market init
'''

**MCP tools:** [cli-market.dev/tools](https://cli-market.dev/tools?utm_source=devto&utm_campaign=spike-jun09)

**Docs for agents:** [cli-market.dev/llms.txt](https://cli-market.dev/llms.txt)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Pricing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

| Tier | Price | Best for |
|------|-------|----------|
| Free | $0 | 1,000 req/day — prototype with `market init` |
| **Pro** | **$39/mo** | Alerts, full MCP tools, checkout, 20k req/day, 30d history — [activate](https://cli-market.dev//#pricing?utm_source=devto&utm_campaign=week2) |

CLI Market — Commerce infrastructure for AI agents. 38 retailers. 8 countries. MIT on PyPI.