Anylist

From mvanhorn/printing-press-library · View interactive version

Anylist is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Every AnyList feature in your terminal — plus offline search, store routing, and cron-safe automations no mobile... Trigger phrases: `add to my grocery list`, `what recipes can I make with`, `build my shopping list from meal plan`, `check off items on anylist`, `use anylist`, `run anylist`.

How to use this skill

Skill file

AnyList — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the anylist-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install anylist --cli-only

```

  1. Verify: anylist-pp-cli --version
  2. Ensure the reported install directory is on $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.5 or newer). This installs into $GOPATH/bin (default $HOME/go/bin), so add that directory to $PATH instead:

go install github.com/mvanhorn/printing-press-library/library/food-and-dining/anylist/cmd/anylist-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.

When to Use This CLI

Use anylist-pp-cli when you need to automate grocery and meal planning workflows from the shell or in agent pipelines. It excels at cron-based shopping list generation from meal plans, offline recipe search by ingredient or metadata, and store-optimized shopping output. It is the right choice when you need JSON output from AnyList operations for downstream processing with jq, or when you want to build Home Assistant / n8n automations beyond what the basic hacs-anylist integration supports.

Unique Capabilities

These capabilities aren't available in any other tool for this API.

Local state that compounds

_Use this when an agent needs to suggest meals from available pantry items without making multiple API calls._

```bash

anylist-pp-cli recipes search --query chicken --ingredient --agent

```

_Use this when an agent needs to find recipes that fit a time or quality constraint for meal planning._

```bash

anylist-pp-cli recipes filter --max-prep 30 --min-rating 4 --collection Weeknight --agent

```

_Use this when an agent needs to generate a structured shopping route across multiple stores._

```bash

anylist-pp-cli lists by-store --name Groceries --agent

```

_Use this as a read-only audit before adding ingredients — it reports what is missing so the AI can make the right reuse/create/ask decisions._

```bash

anylist-pp-cli recipes missing --recipe "Pasta Bake" --list Groceries --agent

```

_Use this when an agent needs to present the week's meal plan in a human-readable format for sharing or review._

```bash

anylist-pp-cli meal summary --week | pbcopy

```

_Use this when an agent needs to locate an item without knowing which list it was added to._

```bash

anylist-pp-cli items search --query "almond milk" --agent

```

_Use this before adding a packaged product. Passing the returned barcode to items add lets AnyList receive the identifier first and enrich the item when its catalog has a match._

```bash

anylist-pp-cli items lookup --barcode 049000028904 --json

anylist-pp-cli items add --list Groceries --item "Coca-Cola" --barcode 049000028904 --package-size "12 count, 12 fl oz" --apply

```

```bash

anylist-pp-cli items update --list Groceries --item "Milk" --package-size "12 oz carton" --apply --json

printf '%s\n' '{"list":"Groceries","item":"Milk","package_size":"12 oz carton","apply":true}' | anylist-pp-cli items update --stdin --json

anylist-pp-cli items update --list Groceries --item "Milk" --name "Whole Milk" --apply --json

printf '%s\n' '{"list":"Groceries","item":"Whole Milk","name":"Milk","apply":true}' | anylist-pp-cli items update --stdin --json

anylist-pp-cli items update --list Groceries --item "Milk" --category Produce --apply --json

anylist-pp-cli items update --list Groceries --item "Milk" --store "Paris Walmart" --apply --json

anylist-pp-cli items update --list Groceries --item "Milk" --remove-store "Paris Walmart" --apply --json

anylist-pp-cli items update --list Groceries --item "Milk" --price 3.49 --apply --json

anylist-pp-cli items update --list Groceries --item "Milk" --clear-price --apply --json

```

--clear-price without --price-store clears every store-specific price returned for the live item and verifies that no positive price remains. Use --price-store <id> to clear only one store's price while preserving prices for other stores.

```bash

anylist-pp-cli items photo attach --list Groceries --item "Milk" --file milk.jpg --dry-run --json

anylist-pp-cli items photo attach --list Groceries --item "Milk" --file milk.jpg --apply --json

```

Agent-native plumbing

_Use this in a cron job or agent workflow to pre-populate the shopping list before a weekly grocery trip._

```bash

anylist-pp-cli meal add-to-list --week --list Groceries --dry-run

```

```bash

anylist-pp-cli recipes ingredients --name "Pasta Bake" --list Groceries --scale 4 --agent

```

_Use this in a post-trip automation to reset the list for the next week without manually unchecking each item._

```bash

anylist-pp-cli lists reset --name Groceries --keep-unchecked

```

_Use this as a cron preflight check to ensure agent operations run against up-to-date local data._

```bash

anylist-pp-cli sync status --stale-after 24h || anylist-pp-cli sync

```

Use the global --db <path> option for an isolated per-run SQLite cache. AnyList returns one complete user-data envelope, so sync --resources <hint> is an automation hint rather than a server-side filter; --full explicitly requests the normal complete refresh.

AnyList Meal Planning Workflow

Use this skill as the coordinator and the press as its factual execution layer. The workflow is intentionally approval-gated: recipe selection and ingredient identity are AI decisions; AnyList writes are explicit stable-ID operations.

Preferences

On the first run, conduct the complete interview and ask which answers should become defaults: purpose and cadence; number of meals, dates, servings and leftovers; budget and nutrition goals; dietary restrictions, allergies and disliked foods; preferred, limited and excluded proteins; cuisine, difficulty, time and equipment; freezer and pantry/fridge inventory; target AnyList list, store, ZIP code and aisle/category preferences; review/debug mode; and whether calendar events should be scheduled after approval. Save only non-secret preferences.

On later runs, print the saved profile and ask whether to use it unchanged, customize this run only, or edit and save the defaults. One-run overrides do not silently change the saved profile. The companion skill stores the profile at ~/.config/anylist-meal-planning/preferences.json with mode 0600.

Curate, approve, then resolve

Read recipes, collections, servings, preparation time, nutrition and available item metadata. Prefer economical recipes that share staples, avoid recent repeats, and provide variety. Return the proposed recipes and a raw combined ingredient list for approval; do not write recipes, calendar events or shopping-list items before approval. After approval, ask what is already in the pantry/fridge.

The recipes ingredients packet preserves each source ingredient separately, including wording, quantity, note, recipe and form context, and returns fresh candidate facts such as stable IDs, checked state, quantity, notes, UPC, package size, photos, stores, categories and stored prices. The AI then chooses reuse, recycle, create, skip (pantry), or ask (ambiguous). It must not infer block, sliced or shredded cheese when the recipe does not specify the form.

Review table before writes

When review/debug mode is enabled, show the following table before any shopping-list mutation:

| Ingredient needed | Form/package | Proposed AnyList item | Source | Metadata comparison | UPC action | Stored price | Proposed action | Confidence/notes |

|---|---|---|---|---|---|---:|---|---|

| ½ cup cheddar | unresolved | — | — | block/sliced/shredded differ | ask | — | ask | recipe does not specify form |

| 1 gallon milk | gallon | Milk - Gallon | historical | package and barcode agree | reuse | $3.48 | recycle | previous item has best metadata |

| 8 oz shredded cheese | shredded, 8 oz | Shredded Sharp Cheddar Cheese | current | strongest metadata among candidates | keep | $2.97 | reuse | selected stable ID |

| jarred garlic | jar | — | new | no suitable candidate | attempt lookup | — | create | UPC pending |

The table distinguishes current exact items, historical items, metadata mismatches, new items and unresolved ambiguity. With review/debug off, the same AI resolution is still required; the table is simply omitted.

Pricing and UPC enrichment

For now, report only prices already stored on AnyList, with a known-price subtotal and missing-price count. Always disclose: Prices come from stored AnyList item data. They may be outdated, incomplete, or missing; this is not a live Walmart price or availability quote. ZIP-aware live store pricing and aisle lookup require a future Walmart press.

When creating a new item, the AI may propose a UPC only when product form and package are specific. Use items lookup --barcode or barcode-first creation, then read the item back and compare the returned name, brand, package size, photo, price, store and category. Never attach a guessed UPC to a generic ingredient; ask when multiple products are plausible. If AnyList does not enrich programmatic writes as the app does, leave uncertain metadata unset and report that limitation.

Partial-Quantity Accounting Rule

Every partial amount — regardless of whether it comes from a bag, jar, box, bottle, or loose unit — is compared against each scaled recipe requirement and resolved as skip (pantry), buy-shortfall/remainder (recycle an existing item or create a new one with the right stable ID), or ask (ambiguous). This rule applies per-run and must hold on repeated runs: if a previous run recycled a gallon of milk, the next run compares against the remaining gallon quantity, not the original full quantity.

Apply and verify

Remain read-only until recipe approval, pantry adjustments, ingredient decisions and the review gate are complete. Preview by default; pass --apply for live mutations on commands that support writes. Bulk paths fail closed: meal add-to-list and recipes add-to-list/recipes batch-add do not support --apply — they preview or fail closed. Live writes use explicit stable-ID operations (items add / items update --item-id) with --apply, followed by fresh read-after-write verification. Reuse or recycle only the selected stable ID, preserve quantity and package size, protect checked items, perform fresh reads, and report partial failures without silently retrying as new items. Calendar create/update/delete is supported behind the same explicit --apply and fresh read-back gate; a disposable live round-trip has been verified.

Command Reference

categories — View item categories, and create, rename, delete, or reorder custom categories

collections — List recipe collections and preview collection writes. Create/add/remove/delete previews are available, but live writes currently fail closed because a disposable AnyList create acknowledged HTTP success without persisting on fresh read-back. Do not use --apply until a future live probe proves the exact collection contract.

favorites — Manage favorite items with explicit apply gates and fresh read-after-write verification. Photo and price mutation remain separate capabilities.

folders — View and safely organize shopping-list folders. Preview is the default and --apply is required for live mutations; enabled mutations require fresh read-back before cache sync.

Create/delete, rename, parent movement, and child ordering use handlers verified against live fresh read-back; the APK-equivalent set-ordered-folder-items payload is recorded in .printing-press-patches/review-folder-ordering-live-probe.json.

items — Manage items within a shopping list

lists — Manage shopping lists. Create, rename, delete, item reset, cached settings reads, initial settings creation, settings clear, the live-verified item sort-order and eleven boolean setting updates, notification-location changes, and invite-add are available with explicit --apply gates and fresh read-back checks. Sharing removal, stop-sharing, household-user writes, and other settings remain fail-closed.

meal — Manage the meal planning calendar

recipes — Manage recipes — import, organize, add to shopping lists, and manage recipe-sharing links. Sharing writes are preview-only by default and require explicit --apply plus fresh read-back verification; email/print sending is not exposed.

recipes import-paprika --input <path> parses the complete .paprika/.paprikarecipe input and previews planned creates, skips, and duplicate candidates without network access. --apply is required for AnyList writes; --update-existing opts into updates, ambiguous matches are rejected, and live ingredient/step content is verified before cache refresh. Paprika categories are report-only; photo, collection, and Walmart operations are not guessed.

recipes import --url <url> skips an exact-name duplicate by default. Use --on-duplicate update to replace a unique matching recipe, or --on-duplicate allow to create another copy. Ambiguous updates fail closed. recipes duplicates reports the local exact-name groups that need cleanup.

Recipe photo commands use the captured /data/photos/upload plus save-recipe protobuf flow. Attach and clear are preview-only by default, require --apply for writes, verify the complete photo-ID result with a fresh live read, and sync the photo IDs into the local cache. Recipe sharing uses the separate typed link-request endpoints; it does not send email or print invitations.

starters — Manage user starter-list items with explicit apply gates and fresh read-after-write verification. Photo and price mutation remain separate capabilities.

stores — View stores and store filters (write operations are not exposed). AnyList does not provide a ZIP-aware Walmart price/availability query; use a separate Walmart press for that capability.

export — Create a local JSON snapshot

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

anylist-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Recipes

Sunday meal-prep: build grocery list from this week's plan

Phase 1 — read raw ingredient facts:

anylist-pp-cli recipes ingredients --name "Pasta Bake" --list Groceries --scale 4 --agent

Phase 2 — AI resolves identity and pantry quantities, then shows the review table:

Compare each partial amount (½ cup, 8 oz, 1 gallon, etc.) against the scaled recipe requirements. Resolve as: skip (pantry), buy-shortfall/remainder (recycle or create with stable ID), or ask (ambiguous). Show the review table with proposed actions.

Phase 3 — explicit item operations (no bulk):

anylist-pp-cli items update --item-id <id> --quantity 4 --apply --json
anylist-pp-cli items add --list Groceries --item "Shredded Sharp Cheddar Cheese" --package-size "8 oz bag" --apply --json

Phase 4 — read-after-write verification:

anylist-pp-cli items list --list Groceries --agent

meal add-to-list --week --dry-run previews ingredients only. Live bulk writes on this command are disabled (fail closed).

Find quick weeknight recipes with available chicken

anylist-pp-cli recipes search --query chicken --ingredient --agent | anylist-pp-cli recipes filter --max-prep 30 --min-rating 4

Search by ingredient then filter by metadata — pure offline SQLite, no API calls.

Check what you still need before adding a recipe

anylist-pp-cli recipes missing --recipe "Thai Green Curry" --list Groceries --agent

Shows only the ingredients not already on your shopping list — use this as a read-only audit before the AI decides whether to reuse, create, or ask.

Get per-store shopping route as structured JSON

anylist-pp-cli lists by-store --name Groceries --agent --select name,storeName,category

Groups items by store with sort_index ordering; --select narrows the payload for agent context.

Post-trip cleanup + next-week reset via cron

anylist-pp-cli lists reset --name Groceries --keep-unchecked && anylist-pp-cli sync status --stale-after 12h || anylist-pp-cli sync

Remove checked items, keep unchecked, then ensure cache is fresh — safe to run in a cron job.

Auth Setup

AnyList uses email + password authentication returning a short-lived access_token and a refresh_token. The CLI stores these in ~/.config/anylist-pp-cli/config.toml and transparently refreshes on 401 responses. All requests require two additional headers: X-AnyLeaf-API-Version: 3 and a stable X-AnyLeaf-Client-Identifier (a 32-char hex UUID generated once per device and reused).

Run anylist-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

anylist-pp-cli categories --agent --select id,name,status

```

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

anylist-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
anylist-pp-cli feedback --stdin < notes.txt
anylist-pp-cli feedback list --json --limit 10

Entries are stored locally at ~/.anylist-pp-cli/feedback.jsonl. They are never POSTed unless ANYLIST_FEEDBACK_ENDPOINT is set AND either --send is passed or ANYLIST_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

anylist-pp-cli profile save briefing --json
anylist-pp-cli --profile briefing categories
anylist-pp-cli profile list --json
anylist-pp-cli profile show briefing
anylist-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 4 | Authentication required |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show anylist-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

Install the MCP binary from this CLI's published public-library entry or pre-built release, then register it:

claude mcp add anylist-pp-mcp -- anylist-pp-mcp

Verify: claude mcp list

Direct Use

  1. Check if installed: which anylist-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

anylist-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: anylist-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.