Pantry

Manage and analyze your pantry inventory.

Usage

cook pantry [OPTIONS] <COMMAND>

Options

OptionDescription
-b, --base-path <PATH>Base path for recipes and configuration files
-f, --format <FORMAT>Output format: human (default), json, yaml

Subcommands

depleted (alias: d)

Show items that are out of stock or have low quantities.

cook pantry depleted [OPTIONS]
OptionDescription
--allShow all items including those without quantities

Items are flagged when current quantity is at or below the low threshold. Without a low threshold, uses heuristics.

expiring (alias: e)

Show items that are expiring soon.

cook pantry expiring [OPTIONS]
OptionDescription
-d, --days <DAYS>Number of days to look ahead (default: 7)
--include-unknownInclude items without expiry dates

recipes (alias: r)

List recipes that can be made with items currently in pantry.

cook pantry recipes [OPTIONS]
OptionDescription
-p, --partialInclude partial matches (most ingredients available)
--threshold <PERCENT>Minimum percentage of ingredients for partial matches (default: 75)

plan

Analyze ingredient usage across recipes to help plan pantry items.

cook pantry plan [OPTIONS]
OptionDescription
-n, --max-ingredients <N>Maximum number of ingredients to show (default: all needed for 100% coverage)
-s, --skip <N>Skip the first N ingredients (default: 0)
-m, --allow-missing <N>Allow recipes to be considered cookable even if N ingredients are missing (default: 0)

Configuration

The pantry inventory is defined in pantry.conf (TOML format), searched in:

  1. ./config/pantry.conf — local to recipe directory
  2. ~/.config/cook/pantry.conf — global configuration

Format

[fridge]
milk = { quantity = &#34;500%ml&#34;, low = &#34;200%ml&#34;, expire = &#34;2025-09-20&#34; }
eggs = { quantity = &#34;12&#34;, low = &#34;6&#34;, bought = &#34;2025-09-10&#34;, expire = &#34;2025-09-25&#34; }
butter = &#34;250%g&#34;

[pantry]
flour = { quantity = &#34;2%kg&#34;, low = &#34;500%g&#34; }
salt = &#34;1%kg&#34;

Item attributes: quantity, low (threshold), bought (date), expire (date). Simple format (item = "quantity") also supported.

Examples

# Show low/out-of-stock items
cook pantry depleted

# Items expiring in the next 14 days
cook pantry expiring --days 14

# Recipes you can fully make
cook pantry recipes

# Recipes with at least 60% of ingredients
cook pantry recipes --partial --threshold 60

# Plan pantry stocking
cook pantry plan

# JSON output
cook pantry -f json depleted

Notes

  • Unit comparisons only work when units match (e.g., g vs g, not kg vs g)
  • For items without units, use plain numbers (e.g., eggs = { quantity = "6", low = "12" })