Clifood Agent Skill
Purpose
This skill is for AI agents that want to order food on iFood via the CLI: search restaurants, search items, build carts, and prepare checkout. It uses the authenticated browser session to call iFood APIs directly (no UI scraping).
Quick start (agent usage)
- Ensure a logged-in browser session with a delivery address.
- Run CLI commands from repo root.
Examples:
bun src/cli.ts restaurants --top --exclude-defaults --limit 10
bun src/cli.ts items --restaurant "Restaurante X" --query "temaki"
bun src/cli.ts order --restaurant "Restaurante X" --item "Temaki de salmão:2"
Core workflow (agent-friendly)
-
Open session + auth
- The CLI opens a Playwright browser context and reads Redux state (account + address).
getApiContext(page)captures required headers from live API calls.
-
Find restaurants / items
- Restaurants:
restaurantscommand (search or--topdiscovery feed). - Items:
itemscommand (reads merchant catalog).
- Restaurants:
-
Build cart + prep order
ordercommand resolves items withbuildCartItemsand creates a cart via API.- It opens cart + checkout for review.
-
Checkout safety
- The CLI does not submit orders unless
--confirmis provided. - Agents should stop at checkout unless explicitly asked to place the order.
- The CLI does not submit orders unless
Tracking orders
Order tracking is not implemented yet. If you need it:
- Add an API call in
src/ifood/api.ts. - Update the CLI with a
trackcommand. - Document the endpoint in
references/api.md.
Implementation notes (when extending)
- Discovery and category APIs require a POST body (see
references/api.md). - Catalog API requires
access_key/secret_keycaptured from a merchant page. - Use parser helpers in
src/ifood/parsers.tsandnormalizeTextfor filtering.
References
docs/architecture.mdfor the full API flow.docs/troubleshooting.mdfor auth/anti-bot issues.references/api.mdfor endpoint summary.