Best for
- Add a product to an Instacart cart by natural language ("add lemon sorbet to QFC")
- Add something they have bought before ("add my usual milk to Safeway")
- Show, search, or compare their active carts across retailers
mvanhorn/printing-press-library/cli-skills/pp-instacart/SKILL.md
Printing Press CLI for Instacart. Natural-language Instacart CLI that talks directly to the web GraphQL API. Add items to your cart, search products, and manage carts across retailers without browser automation. Also caches your purchase history locally so 'add' resolves items you have bought before instead of guessing from live search. Trigger phrases: 'install instacart', 'use instacart', 'run instacart', 'add X to my Safeway cart', 'what did I buy last time', 'order the usual', 'add my regula
Decision brief
Printing Press CLI for Instacart. Natural-language Instacart CLI that talks directly to the web GraphQL API.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/mvanhorn/printing-press-library --skill "cli-skills/pp-instacart"Inspect the Agent Skill "pp-instacart" from https://github.com/mvanhorn/printing-press-library/blob/aa81bd36b15050900d4e6b8cb1529731bf0d239e/cli-skills/pp-instacart/SKILL.md at commit aa81bd36b15050900d4e6b8cb1529731bf0d239e. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Then backfill history (optional but recommended; unlocks history-first add):
Requires a logged-in Instacart session in Chrome. The CLI extracts cookies via kooky (no credential handling on our side). If Chrome is locked or you are on a system kooky cannot read:
Instacart's GraphQL API requires location data (latitude/longitude or an addressid) on every retailer lookup. Without it, search, add, and cart show fail at the ShopCollectionScoped bootstrap step.
This skill drives the instacart-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
Reach for this when a user wants:
Permission review
The documentation asks the agent to run terminal commands or scripts.
npx -y @mvanhorn/printing-press-library install instacart --cli-onlyThe documentation asks the agent to run terminal commands or scripts.
go install github.com/mvanhorn/printing-press-library/library/commerce/instacart/cmd/instacart-pp-cli@latestEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 1,965 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
This skill drives the instacart-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
$HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:
npx -y @mvanhorn/printing-press-library install instacart --cli-only
instacart-pp-cli --version$PATH for the agent/runtime that will invoke this skill.If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):
go install github.com/mvanhorn/printing-press-library/library/commerce/instacart/cmd/instacart-pp-cli@latest
If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.
Reach for this when a user wants:
Do not reach for this if the user wants to actually check out. This CLI adds items to your cart; you still complete checkout in the Instacart app or web UI.
addadd checks your local purchase history FIRST and, when a confident match exists at the target retailer, skips the three-call live GraphQL chain entirely. Drops the cost of "add the lemon sorbet pops I usually get" from ~1.2s to ~200ms AND makes it resolve to the right SKU (the one you actually buy) instead of whatever live search ranks highest today.
Confidence rules:
Falls through to today's live-search behavior when any condition fails. Pass --no-history to force live search.
Every successful add (history-resolved or live-resolved) writes back to purchased_items so the signal gets warmer without a full re-sync.
Typing "backfill my instacart orders" (or similar, see Argument Parsing) kicks off a Chrome-MCP-driven flow that walks the user's logged-in Instacart tab, extracts their order history into JSONL, and imports it into the local DB. After backfill, add resolves from real purchase history instead of live-search guesses.
Primary path: Chrome MCP. Fallback: paste three JS files into DevTools by hand.
Full walkthrough below under "Backfill Flow". Reference docs with more detail:
docs/backfill-walkthrough.md — Chrome MCP flowdocs/backfill-devtools-fallback.md — manual DevTools flowhistory list / history search / history stats inspect whatever has been loaded.
Instacart does not expose a clean order-history GraphQL op, so the legacy history sync command cannot work. See docs/solutions/best-practices/instacart-orders-no-clean-graphql-op.md for why.
addResolves a product from free-text via Instacart's own three-call GraphQL chain (ShopCollectionScoped -> Autosuggestions -> Items) and fires UpdateCartItemsMutation. No browser automation.
When Instacart rejects a candidate with notFoundBasketProduct (autosuggest occasionally surfaces a product that is not addable at your active cart's shop), add automatically retries up to 3 ranked candidates before giving up. In --json output a successful retry sets retry_count > 0 and includes an attempts array listing the rejected item ids. When history-first resolution hits the same error, add falls through to live search and reports resolved_via: "history->live".
cartscarts list shows every active cart across retailers at once. Useful for agents that need to know where items live before adding to the right one.
Authentication:
instacart auth login - extract session cookies from Chromeinstacart auth status - show current session stateinstacart auth logout - clear saved cookiesinstacart auth paste - paste cookie JSON manually (fallback for newer macOS Chrome)instacart auth import-file <path> - load cookies from a browser-use export JSONCart operations:
instacart add <retailer> <query...> - add a product by natural languageinstacart add <retailer> <query...> --no-history - skip the history-first resolverinstacart add --item-id <id> <retailer> - add by exact Instacart item idinstacart cart show <retailer> - show current cart contents at a retailerinstacart cart remove <item-id> <retailer> - remove an item from a cartinstacart carts list - list every active cart across retailersDiscovery:
instacart search <query> --store <retailer> - search products at a retailerinstacart retailers list - list retailers available at your addressinstacart retailers show <slug> - cache one retailer locallyPurchase history:
instacart history import <path> - load a JSONL order dump into the local DB (the working path)instacart history import - --json - read from stdin, JSON output for agent pipelinesinstacart history import <path> --dry-run - preview counts without writinginstacart history list - top purchased items by count + recencyinstacart history list --store <retailer> --limit 20 - filter + paginateinstacart history search <query> - FTS search your purchase historyinstacart history search <query> --store <retailer> - scoped FTS searchinstacart history stats - counts + per-retailer stateMaintenance:
instacart doctor - health check: config, store, ops, history, session, live pinginstacart capture - refresh the GraphQL operation hash cacheinstacart capture --remote - merge fresh hashes from the community registryinstacart ops list - show the operation-hash cache stateinstacart auth login # extract cookies from Chrome
instacart doctor # verify auth + live ping
instacart capture # seed built-in op hashes
Then backfill history (optional but recommended; unlocks history-first add):
Tell the agent: "backfill my instacart orders"
The skill drives the rest. See the "Backfill Flow" section below.
instacart add safeway "oat milk" # resolves via local history if you have bought it before
Look for via history in the output. If you see via live, the FTS match did not pass the confidence check; check instacart history search "oat milk" --store safeway to see what is actually in your history.
instacart add safeway "oat milk" --no-history --dry-run --json
--dry-run --json is useful when debugging - the output includes resolved_via so you can see which path would have fired.
instacart history list --store safeway --limit 20 --json | jq -r '.[].name' \
| while read item; do instacart add safeway "$item" --yes --json; done
Requires a logged-in Instacart session in Chrome. The CLI extracts cookies via kooky (no credential handling on our side). If Chrome is locked or you are on a system kooky cannot read:
instacart auth paste # paste the full cookie JSON manually
instacart auth import-file <path>
Session lives at ~/.config/instacart/session.json (0600).
Instacart's GraphQL API requires location data (latitude/longitude or an address_id) on every retailer lookup. Without it, search, add, and cart show fail at the ShopCollectionScoped bootstrap step.
The post-auth login step auto-populates address_id, postal_code, latitude, and longitude from your default Instacart address. If that doesn't work, the agent should fall back to one of:
instacart config set-address --id <uuid> — derives coords from a known Instacart address ID via the cached GetAddressById op. Find the ID in the URL or a graphql variable on https://www.instacart.com/store/account/your-account (DevTools Network tab).instacart config set-coords --lat <N> --lon <N> [--postal <zip>] — pass coordinates directly (Google Maps right-click → "What's here?" returns lat/lon).instacart config show — confirm what's currently set.instacart doctor surfaces a location: fail check whenever this is missing, so an agent driving the CLI can detect the broken state before invoking a real command.
config profiles is a named-address store on top of the single active-location config. Use it when the user has more than one delivery address (home, work, vacation house) and wants to switch without re-running config set-address each time.
instacart config profiles list — show saved profiles; the active one is marked with *.instacart config profiles add <name> --id <address_id> [--label "..."] [--use] — save a profile by Instacart address ID (uses GetAddressById to fill coords). Pass --use to also activate it.instacart config profiles add <name> --lat <N> --lon <N> [--postal <zip>] [--label "..."] — save a profile by raw coordinates, no network call.instacart config profiles use <name> — switch the active profile (copies its location onto the top-level config keys so every downstream call uses it).instacart config profiles show <name> — print one profile.instacart config profiles rm <name> — delete a profile. If it was active, the active profile is cleared and the existing top-level config still applies.instacart config profiles import [--prefix <p>] [--overwrite] [--use <name>] — fetch every saved address from the user's Instacart account (via CurrentUserAddresses) and save each as a profile, slugifying the street address for the name.Per-call override: pass --profile <name> to any command that needs location (e.g. instacart --profile work add safeway "cold brew"). This applies the named profile for that single call without changing the active profile.
When no profiles are defined, the CLI behaves exactly as before — config set-coords / set-address / show continue to drive the top-level location keys directly.
The CLI is agent-native by default. Pass --json on any command for machine-readable output. --dry-run previews add without firing the mutation and surfaces which resolver (history, live, or item-id) would have fired.
add JSON envelope fields worth knowing:
resolved_via: one of history, live, history->live (history pick was rejected, live retry succeeded), or item-id.retry_count: how many candidates were rejected before the winner. 0 when the first pick landed.attempts: present only when retry_count > 0, array of {item_id, name, error_type} for each rejected candidate.error, retailer, query, attempts, and a hint naming the concrete next step (search then add --item-id, or retry with --no-history).--select accepts dotted paths to descend into nested responses; arrays traverse element-wise:
instacart-pp-cli <command> --agent --select id,name
instacart-pp-cli <command> --agent --select items.id,items.owner.name
Use this to narrow huge payloads to the fields you actually need — critical for deeply nested API responses.
Data-layer commands wrap output in {"meta": {...}, "results": <data>}. Parse .results for data and .meta.source to know whether it's live or local. The N results (live) summary is printed to stderr only when stdout is a TTY; piped/agent consumers see pure JSON on stdout.
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error |
| 3 | Auth missing or rejected |
| 4 | Resource not found |
| 5 | API error / conflict |
| 7 | Rate limited or transient network |
Given a free-form natural-language request:
help, or --help -> run instacart --helpinstall -> CLI install; ends with mcp -> MCP install--json when invoked from an agentDrive this when the user hits a backfill intent. Read docs/backfill-walkthrough.md via WebFetch for the full procedure; summary below.
Setup check:
instacart-pp-cli is on PATH. If not, install: go install github.com/mvanhorn/printing-press-library/library/commerce/instacart/cmd/instacart-pp-cli@latest.mcp__claude-in-chrome__tabs_context_mcp. If the tool is unavailable, route to the DevTools fallback: fetch docs/backfill-devtools-fallback.md and walk the user through it. Stop.instacart-pp-cli history stats --agent. If orders > 0, this is a top-up run; the resume state will skip already-dumped orders automatically.Chrome MCP loop:
https://raw.githubusercontent.com/mvanhorn/printing-press-library/main/library/commerce/instacart/docs/dumper.jshttps://raw.githubusercontent.com/mvanhorn/printing-press-library/main/library/commerce/instacart/docs/extract-one.jshttps://raw.githubusercontent.com/mvanhorn/printing-press-library/main/library/commerce/instacart/docs/export-jsonl.jshttps://www.instacart.com/store/account/orders. If the dumper returns profile_picker: true, ask the user to pick a profile in the tab, then re-run.dumper.js via mcp__claude-in-chrome__javascript_tool. Read back total_ids and pending_extract./store/orders/<id> then inject extract-one.js. Report progress to the user every 10 orders.export-jsonl.js. It downloads instacart-orders.jsonl to the user's default Downloads folder.instacart-pp-cli history import ~/Downloads/instacart-orders.jsonl --agent in a Bash tool. Show the summary JSON to the user.instacart-pp-cli history stats --agent. Offer a follow-up sanity check: instacart-pp-cli add <retailer> "<something they've bought>" --dry-run --json and flag resolved_via: "history" when it appears.Error surfaces worth translating for the user:
cache_key_missing on every order -> Instacart rotated their web bundle. Report the observed cache keys and point at the rotation-recovery section of the walkthrough doc.history import shows 0 orders imported -> the JSONL is empty (only skip records). Re-run the extractor loop with fresh tabs.which instacart-pp-cliinstacart doctorinstacart captureadd resolution.--json if invoked from an agentFrequently asked questions
Printing Press CLI for Instacart. Natural-language Instacart CLI that talks directly to the web GraphQL API.
The source record exposes this install command: npx skills add https://github.com/mvanhorn/printing-press-library --skill "cli-skills/pp-instacart". Inspect the command and pinned source before running it.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
mvanhorn/printing-press-library
Printing Press CLI for Instacart. Natural-language Instacart CLI that talks directly to the web GraphQL API. Add items to your cart, search products, and manage carts across retailers without browser automation. Also caches your purchase history locally so 'add' resolves items you have bought before instead of guessing from live search. Trigger phrases: 'install instacart', 'use instacart', 'run instacart', 'add X to my Safeway cart', 'what did I buy last time', 'order the usual', 'add my regula
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing