- Guides
- Pantry Management
Pantry Management
Keep a plain-text inventory of what is in your kitchen so shopping lists only contain what you actually need to buy.
You will use: CookCLI, cook server
A pantry file is a short list of what you have on hand: staples, spices, what is in the fridge and freezer. Once it exists, every shopping list you generate subtracts it, and CookCLI can tell you what is running low, what is about to expire, and which recipes you could cook tonight without going to the shop.
Pantry tracking currently works in CookCLI and the
cook serverweb UI. The mobile app does not readpantry.confyet.
What you need
- CookCLI 0.35 or newer
- A recipe folder.
cook seed ~/recipesgives you a sample collection with a pantry file already in place.
Run everything from inside the recipe folder:
1. Create the pantry file
The pantry lives at config/pantry.conf next to your recipes and uses TOML. Sections are storage locations; each line is one ingredient. Start small: the staples you never want to see on a shopping list.
Format rules:
- Names with spaces need quotes, both for items (
"olive oil") and sections (["spice rack"]). Names are matched case-insensitively against recipe ingredients, so use the same wording your recipes do. - Quantities use Cooklang notation:
"250%g","2%l","12"for a plain count."some"and"unlim"are accepted for things you never run out of, such as tap water or garden herbs. - A bare string is shorthand for
{ quantity = "..." }. Use the table form when you want more attributes. - Optional attributes:
low(threshold that flags the item as running out),expireandbought(dates asYYYY-MM-DD).
You can also let CookCLI write the file. cook pantry add creates config/pantry.conf and the section if they are missing:
2. Check what CookCLI sees
To see how much of your recipe collection the pantry already covers:
Ingredients that show up in recipes but not in the pantry are the candidates for step 1.
3. Generate a shopping list that skips the pantry
Nothing extra to do. As soon as config/pantry.conf exists, cook shopping-list subtracts it:
The sample pantry holds water and olive oil, so neither appears in the output even though both recipes need them. The subtraction is quantity-aware: 125 g of flour against 1 kg in the pantry disappears, but 1.5 kg against 1 kg would leave 500 g on the list.
Units have to match. A recipe that needs 250%ml of milk is not compared with a pantry entry of 2%l; CookCLI prints Unit mismatch for 'milk' and leaves the milk on the list to be safe. Write pantry quantities in the unit your recipes use, or use bare counts for things like eggs.
To see the full list regardless of the pantry, or to point at a pantry file kept elsewhere:
4. Keep it current
The pantry is only useful if it is roughly right. Two habits keep it that way.
After shopping, update quantities. Only the flags you pass change:
Before shopping, ask what is running out. Items at or below their low threshold, and items with a quantity of zero, are flagged:
Items without a low threshold are judged by a heuristic, so set thresholds on the things you care about.
Expiry dates get their own check:
5. Cook from the pantry
The reverse question is often more useful on a weeknight: what can I make right now?
Loosen the match to see recipes that are one shop away:
cook pantry plan goes one step further and ranks ingredients by how many of your recipes they unlock, which is a good way to decide what to stock.
Machine-readable output
Every cook pantry command takes -f json or -f yaml before the subcommand, handy for a home dashboard or a script that nags you about expiring food:
Troubleshooting
| Symptom | Fix |
|---|---|
Cannot parse pantry quantity for 'x': some | Harmless. Words like some are accepted but cannot be subtracted from; the item still counts as "in stock". |
| Pantry item keeps appearing on shopping lists | Check the name matches the recipe ingredient exactly (spaces, plural) and that the units match. |
cook pantry finds no file | It looks in ./config/pantry.conf then ~/.config/cook/pantry.conf. Run from your recipe folder or pass -b <path>. |
| TOML parse error | Quote names containing spaces, and put every item under a [section] header. |
See also
- Shopping Lists: the other half of this workflow
- Meal Planning: plan the week around what needs using up
cook pantryreference: all subcommands and flags- Pantry file format in the conventions