Skip to content

Repository files navigation

🛒 cnt

CI Release License: MIT

Fast CLI for browsing Continente online supermarket products, optimized for LLM consumption. Works as a skill for Claude Code, Claude.ai, OpenAI Codex, OpenClaw, and any AI agent. Search products, compare prices, inspect nutritional info, browse categories, and find nearby stores — with product ordering planned for the future.

Disclaimer: This project is for educational purposes and AI automation research only. The authors are not responsible for any misuse or for any damages resulting from the use of this tool. Users are solely responsible for ensuring compliance with applicable laws and the terms of service of any websites accessed. This software is provided "as-is" without warranty of any kind.

This project is not affiliated with Continente or Sonae MC.

Note: This project was partially developed with AI assistance and may contain bugs or unexpected behavior. Use at your own risk.

Features

  • Search 50,000+ products with brand, price, and dietary filters
  • Full product details with EAN/barcode, nutritional info, and allergens
  • Browse 251 product categories (14 top-level, ~100 L2, ~137 L3)
  • Current weekly flyers and catalogs (iPaper integration)
  • Search autocomplete suggestions
  • Find 228 stores across Portugal with GPS coordinates
  • 6 dietary filters: vegan, vegetarian, gluten-free, lactose-free, sugar-free, bio
  • Multiple output formats: table, JSON, compact (TSV)
  • No authentication required

Installation

From source

cargo install --git https://github.com/nikuscs/continentes

Pre-built binaries

Download from Releases:

Platform File
macOS (Apple Silicon) cnt-macos-arm64.tar.gz
Linux (x64) cnt-linux-x64.tar.gz
Linux (ARM64) cnt-linux-arm64.tar.gz
tar -xzf cnt-*.tar.gz && chmod +x cnt && sudo mv cnt /usr/local/bin/

Usage

Search products

cnt search "leite"                                    # basic search
cnt search "cerveja" --brand "Super Bock"             # filter by brand
cnt search "arroz" --price-min 1 --price-max 3        # price range
cnt search "leite" --vegan --sort price-low-to-high   # dietary + sort
cnt search "bolachas" --gluten-free --page 2          # paginate

Product details

cnt product 6879912                  # basic info
cnt product 6879912 --nutrition      # include nutritional data
Leite UHT Meio Gordo Continente
===============================

ID:           6879912
Brand:        Continente
Price:        0,86€
Unit Price:   0,86€/lt
Package:      emb. 1 lt
Rating:       3.9
Category:     Laticínios e Ovos > Leite > Leite Meio Gordo
EAN:          5601312508007
Badge:        Produzido em Portugal

Browse categories

cnt browse frescos                     # by name (fuzzy match)
cnt browse laticinios-leite            # by exact cgid
cnt browse "cerveja" --sort unit-price  # with sorting

Search suggestions

cnt suggest "arroz"     # autocomplete (min 5 chars)

Find stores

cnt stores --lat 38.7 --lon -9.1              # Lisbon area
cnt stores --lat 41.1 --lon -8.6 --radius 20  # Porto, 20km

List categories

cnt categories            # tree view
cnt categories --format json  # machine-readable

Browse flyers

cnt flyers                    # current weekly flyers
cnt flyers --format json      # machine-readable

Output formats

cnt search "leite"                     # table (default)
cnt search "leite" --format json       # JSON
cnt search "leite" --format compact    # TSV for piping
# Pipe to jq
cnt search "leite" --format json | jq '.products[].name'

# Pipe to other tools
cnt search "leite" --format compact | sort -t$'\t' -k2 -n

Dietary filters

Flag Description
--vegan Vegan products only
--vegetarian Vegetarian products only
--gluten-free Gluten-free only
--lactose-free Lactose-free only
--sugar-free Sugar-free only
--bio Organic/biological only

Sort options

Value Description
relevance Default ranking
price-low-to-high Cheapest first
price-high-to-low Most expensive first
unit-price By price per unit (kg/lt)
name-asc Name A-Z
name-desc Name Z-A

Configuration

Place at ./continente.toml or ~/.config/continente/continente.toml:

[http]
timeout_secs = 30
retries = 3
delay_ms = 100

[output]
format = "table"   # table, json, compact

Global options

Flag Env var Description
--format <FORMAT> Output: table, json, compact
-v, --verbose Debug logging
--config <PATH> CONTINENTE_CONFIG Config file path

AI Agents

If you are an AI agent (Claude Code, Claude.ai, OpenAI Codex, OpenClaw, or any tool-calling agent), you can use cnt as a skill to search Portuguese supermarket products. Download the binary and call it directly from your tool/shell integration. A SKILL.md file is included for Claude Code skill registration.

Quick setup

Download the pre-compiled binary for your platform from Releases and place it in your PATH.

Searching products

# Search with JSON output for parsing
cnt search "leite" --format json

# Filter by dietary requirements
cnt search "queijo" --vegan --format json

# Get full product details with nutrition
cnt product 6879912 --nutrition --format json

# Find cheapest option
cnt search "azeite" --sort unit-price --format json

Building a shopping list

# Search multiple products and extract prices
cnt search "leite" --format json | jq '.products[:3] | .[] | {id, name, price}'
cnt search "pão" --format json | jq '.products[:3] | .[] | {id, name, price}'

Finding stores

# Find nearest stores to coordinates
cnt stores --lat 38.7 --lon -9.1 --format json | jq '.[0] | {name, address, city}'

Tips for agents

  • Use --format json for structured output you can parse
  • Product IDs are numeric strings (e.g., 6879912) — extract from search results
  • Use --nutrition flag on product command for full nutritional data
  • Use --sort unit-price for best value comparisons
  • Dietary filters can be combined: --vegan --gluten-free --bio
  • Categories use internal cgid values — use cnt categories --format json to get the mapping
  • No authentication needed — all endpoints are public

Feel free to copy and adapt this tool's interface into your own skill definitions or MCP server configurations.

How it works

The CLI interacts with Continente's Salesforce Commerce Cloud (SFCC) storefront controllers. These are the same endpoints the website uses — no private APIs, no authentication, no scraping of rendered pages. Product data is extracted from structured data- attributes and JSON responses.

All endpoint details are documented inline in src/api/client.rs.

Related Projects

License

MIT — see LICENSE.

About

Fast CLI for browsing Continente online supermarket products — LLM-ready, works with Claude Code, Codex, OpenClaw, and AI agents. Search, prices, nutrition, categories, stores. Product ordering planned.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages