--- name: superme description: "Online supermarket automation. Login, search products, add to cart/wishlists, magicorder from past orders. Supports Shufersal, Keshet Teamim, Rami Levy, and Tiv Taam. Usage: /superme login , /superme search , /superme add <#>, /superme magicorder, /superme lists, /superme cart, /superme help" risk: medium source: local date_added: "2026-03-21" --- # /superme — Online Supermarket Automation Automate Israeli online supermarkets using browser-use CLI. Supports **Shufersal** and **Keshet Teamim**. --- ## Prerequisites (auto-install) **IMPORTANT:** Before executing ANY command below, always run this first to ensure browser-use is installed: ```bash which browser-use 2>/dev/null || uv tool install browser-use --python 3.12 ``` This is a no-op if already installed, and auto-installs if missing. Run it silently at the start of every `/superme` invocation. --- ## Vendor Detection The skill works against **one vendor at a time**. The active vendor is stored in `/tmp/superme_vendor.txt` (set during login). Login always switches the active vendor. **Vendor identifiers:** - `shufersal` — Shufersal Online (shufersal.co.il) - `keshet` — Keshet Teamim (keshet-teamim.co.il) - `rami` — Rami Levy (rami-levy.co.il) - `tivtaam` — Tiv Taam (tivtaam.co.il) **IMPORTANT — Announce the active vendor:** - After every login, announce: "Switched to **[Vendor Name]**. All commands now target [Vendor Name]." - At the start of every command (search, add, magicorder, etc.), read the vendor file and display which vendor is active: "**[Vendor Name]** >" - If no vendor is set, tell the user to run `/superme login` first. When a command needs to branch by vendor, read the vendor file: ```bash cat /tmp/superme_vendor.txt 2>/dev/null || echo "none" ``` Logging in to a different vendor switches the active vendor. Previous vendor sessions (tokens/cookies) are preserved in their separate temp files, so logging back in may reuse them if still valid. --- ## Session State The skill tracks state across commands within a conversation using temp files: ### Shared (all vendors) - `/tmp/superme_vendor.txt` — active vendor identifier - `/tmp/superme_last_search.json` — last search results with product IDs for `/superme add` ### Rami Levy-specific - `/tmp/superme_rami_token.txt` — JWT token (header: `ecomtoken`) - `/tmp/superme_rami_store_id.txt` — store ID (default: 331) ### Tiv Taam-specific - `/tmp/superme_tivtaam_token.txt` — Bearer token for API calls - `/tmp/superme_tivtaam_user_id.txt` — user ID for API calls ### Shufersal-specific - `/tmp/superme_cookies.json` — exported browser cookies - `/tmp/superme_cookie_str.txt` — cookie string for curl API calls - `/tmp/superme_session_list_id.txt` — current session's wishlist ID (created on first add) ### Keshet Teamim-specific - `/tmp/superme_keshet_token.txt` — Bearer token for API calls - `/tmp/superme_keshet_user_id.txt` — user ID for API calls - `/tmp/superme_keshet_cart_id.txt` — server cart ID --- ## Commands ### `/superme help` Show available commands: ``` /superme login shufersal Log in to Shufersal Online /superme login keshet Log in to Keshet Teamim (SMS OTP) /superme search Search for a product (Hebrew or English) /superme add <#> Add search result # to cart/wishlist /superme magicorder Consolidate last 5 orders into one list /superme lists View Superme wishlists (Shufersal) /superme cart View current cart (Keshet Teamim) /superme close Close the browser session ``` --- ### `/superme login` Log in to a supermarket. Vendor is required as the first argument. --- #### `/superme login shufersal` Log in to Shufersal Online. **Steps:** 1. Ask the user for credentials if not provided inline. Parse from args if given as `/superme login shufersal user@email.com password123`. 2. Open login page: ```bash browser-use --headed --session superme open "https://www.shufersal.co.il/online/he/login" ``` 3. Wait for load, then fill credentials via JavaScript (Shadow DOM inputs): ```bash browser-use --session superme eval "document.getElementById('j_username').value = 'EMAIL'; document.getElementById('j_username').dispatchEvent(new Event('input', {bubbles: true}));" browser-use --session superme eval "document.getElementById('j_password').value = 'PASS'; document.getElementById('j_password').dispatchEvent(new Event('input', {bubbles: true}));" ``` 4. Get state, find submit button (`