← 返回
未分类 Key 中文

Pantry Tracker

Track grocery purchases and monitor food freshness using Supabase. Use when monitoring grocery orders, checking what food is expiring, logging pantry items,...
使用 Supabase 追踪杂货采购并监控食品新鲜度。适用于监控杂货订单、检查即将过期的食品、记录食品库存等场景。
meimakes madebydia 来源
未分类 clawhub v1.3.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 507
下载
💾 1
安装
1
版本
#latest

概述

Pantry Tracker

Track grocery items from purchase to plate (or trash). Parses grocery order emails, stores items in Supabase with estimated expiry dates, and sends daily summaries of what needs eating.

Setup

1. Supabase

Create a Supabase project and run the schema in references/supabase-schema.sql in the SQL editor.

Store credentials as env vars:

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key

Use the anon key (not the service role key). The anon key is safe for client-side use and sufficient for all pantry operations. Never use the service role key — it bypasses Row Level Security.

2. Cron Jobs

Set up two cron jobs in OpenClaw:

Email scanner (every 2-4 hours):

Use the agent's existing email tool (e.g. gog for Gmail, or whatever email skill is installed) to search for grocery order confirmations. This skill does NOT access email directly — the agent reads email through its own authenticated tools, then passes parsed items to the pantry CLI.

Search email for recent grocery orders (Whole Foods, Instacart, Amazon Fresh, Costco, Walmart). Parse item names and quantities. For each item, look up shelf life in references/shelf-life.md and calculate expires_at from today. Write items to a JSON array and run: python3 scripts/pantry.py bulk-add /tmp/pantry-items.json

Morning summary (daily, e.g. 7am):

Run: python3 scripts/pantry.py summary
If output is not "PANTRY_OK", send the summary to the user.

CLI Reference

All commands: python3 scripts/pantry.py

CommandDescription
----------------------
add -c -q -e Add single item
bulk-add Add items from JSON (email parse output)
expiring [--days N]Show items expiring within N days (default 3)
statusFull pantry overview by category
use Mark item as used
toss Mark item as tossed/wasted
refreshAuto-update statuses (fresh → use-soon → expired)
summaryMorning summary for cron (outputs PANTRY_OK if nothing urgent)

Bulk-add JSON format

[
  {
    "name": "Strawberries",
    "category": "produce",
    "quantity": "1 lb",
    "expires_days": 5,
    "source": "whole-foods",
    "order_id": "111-1234567"
  }
]

Email Parsing Guide

When scanning grocery emails, extract:

  1. Item name — normalize to common name (e.g., "Org Strawberries 1lb" → "Strawberries")
  2. Quantity — preserve as-is from email ("2 lbs", "1 bunch", "6 ct")
  3. Category — assign: produce, dairy, meat, bakery, pantry, frozen, other
  4. Shelf life — look up in references/shelf-life.md. If not listed, estimate conservatively.
  5. Source — which store (whole-foods, instacart, costco, etc.)

Supported email patterns

  • Whole Foods / Amazon Fresh: Subject contains "Your delivery" or "order delivered"
  • Instacart: Subject contains "delivery complete" or "order receipt"
  • Costco: Subject contains "order confirmation"
  • Walmart: Subject contains "delivery confirmed"

Search email for these patterns. Parse the item list from the email body. When in doubt about an item's category or shelf life, use conservative estimates.

Manual Usage

Users can also say things like:

  • "Add chicken breast to the pantry, expires in 2 days"
  • "What's expiring soon?"
  • "Mark the strawberries as used"
  • "I tossed the leftover salmon"
  • "What's in my pantry right now?"

Map these to the appropriate CLI commands.

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-03-31 01:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Gmail No Send

meimakes
只读Gmail命令行工具,设计上无法发送邮件。支持搜索、阅读、创建草稿、更新草稿和归档邮件,零发送功能。
★ 0 📥 526
life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 56 📥 85,139
life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 243 📥 30,641