Pantry
Manage and analyze your pantry inventory. Supports full CRUD operations on pantry items as well as analysis commands for stock levels, expiry dates, and recipe planning.
Usage
Options
| Option | Description |
|---|---|
-b, --base-path <PATH> | Base path for recipes and configuration files |
-f, --format <FORMAT> | Output format: human (default), json, yaml |
Subcommands
list (alias: ls)
Display all pantry items organized by section.
| Option | Description |
|---|---|
--section <NAME> | Only show items from this section |
add (alias: a)
Add a new item to the pantry. Creates the pantry file and the section if they do not exist yet.
| Option | Description |
|---|---|
--quantity <VALUE> | Quantity on hand (e.g. 2%kg, 500%ml, 12) |
--low <VALUE> | Low-stock threshold (e.g. 200%g) |
--expire <DATE> | Expiry date (e.g. 2025-06-01) |
--bought <DATE> | Purchase date |
remove (alias: rm)
Remove an item from a section. If the section becomes empty it is deleted from the file too.
update (alias: up)
Update one or more attributes of an existing pantry item. Only the flags you provide are changed; everything else is kept as-is.
| Option | Description |
|---|---|
--quantity <VALUE> | New quantity |
--low <VALUE> | New low-stock threshold |
--expire <DATE> | New expiry date |
--bought <DATE> | New purchase date |
depleted (alias: d)
Show items that are out of stock or have low quantities.
| Option | Description |
|---|---|
--all | Show all items including those without quantities |
Items are flagged when current quantity is at or below the low threshold. Without a low threshold, heuristics are used.
expiring (alias: e)
Show items that are expiring soon.
| Option | Description |
|---|---|
-d, --days <DAYS> | Number of days to look ahead (default: 7) |
--include-unknown | Include items without expiry dates |
recipes (alias: r)
List recipes that can be made with items currently in pantry.
| Option | Description |
|---|---|
-p, --partial | Include partial matches (most ingredients available) |
--threshold <PERCENT> | Minimum percentage of ingredients for partial matches (default: 75) |
plan (alias: pl)
Analyze ingredient usage across recipes to help plan pantry items.
| Option | Description |
|---|---|
-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:
./config/pantry.conf— local to recipe directory~/.config/cook/pantry.conf— global configuration
When you run cook pantry add and no pantry file exists, one is created
at ./config/pantry.conf automatically.
Format
Item attributes: quantity, low (threshold), bought (date), expire (date). Simple format (item = "quantity") is also supported.
Examples
Notes
- Unit comparisons only work when units match (e.g.,
gvsg, notkgvsg) - For items without units, use plain numbers (e.g.,
eggs = { quantity = "6", low = "2" }) pantry updatemerges new values over existing attributes — omitted flags are left unchanged