- Blog
- Recipe Workflows
- The Pantry Problem
The Pantry Problem
I realised something was wrong with how I manage food when I opened my third jar of cumin. I don't love cumin that much. I had forgotten about the other two.
A pantry is an inventory spread over a cupboard, a fridge and a freezer, and the only index is in your head. Human memory is bad at this. You remember that you made a chickpea curry last month. You don't remember whether you replaced the chickpeas afterwards. So you buy another can to be safe, and later find two behind the rice.
Trying harder to remember doesn't fix it. Writing it down does, as long as the list is in a form a program can read. In Cooklang that is one text file.
The file
The pantry lives in config/pantry.conf inside your recipe folder. Here is an example:
Sections are the places where food is kept, and you name them as you like. Each line is one item. A bare string is the amount. The longer form takes four attributes: quantity, low (the level at which you want to be warned), bought and expire. CookCLI warns about any other attribute, so stick to these four.
Shopping lists that know what you have
This is the part that pays for the typing. Once the file exists, cook shopping-list takes it into account. Here are a Thai green curry and pancakes without a pantry:
And with the example pantry:
Coconut milk and flour are gone from the list, because the pantry has enough of both. The rest of the output shows where it is strict:
- Names have to match. The recipe says
eggand the pantry sayseggs, so eggs stay on the list. Use the same words your recipes use. - Units have to match. The recipe wants milk in
mland the pantry has it inl. CookCLI does not convert between them. It prints a warning and leaves milk on the list to be safe. Salt stays for the same reason: a kilo in the pantry cannot be compared with a tablespoon or a pinch. That is also why flour is written as1000%gin the example and not1%kg. - It is quantity-aware. 125 g of flour against 1000 g disappears. 1500 g against 1000 g leaves 500 g to buy.
What needs using first
Printed dates are one thing. The date that matters is the one after which you will throw the food out, and you can write that in expire:
The opposite question is what you can cook tonight without going to the shop:
CookCLI does not yet put the two together. It will not tell you "the spinach expires on Friday, here are three recipes that use it". You read the first list and decide yourself.
Running low
Give an item a low level and it is flagged before it runs out:
It is worth running before you write the shopping list.
The freezer
The freezer is where food goes to be forgotten. A foil parcel with no label might be fish and might be cake.
There is no special attribute for the day something was frozen, and bought does the job. The pesto in the example went in on 2026-09-20, and cook pantry list shows that date next to it, so the oldest things are easy to spot and get used first.
What it does not do
Nothing updates the file when you cook. If you use two tins of tomatoes, the pantry still says two until you change it:
So the file is only as good as your habit of keeping it. The moment that works is while you put the shopping away, when everything is already in your hands.
Two more limits. The mobile app does not read pantry.conf yet, so this works in CookCLI and in the cook server web page. And as the milk shows, units are compared as written.
Start small
My own pantry.conf is short. It lists staples: rice, oats, pasta, tins, oil, flour. Almost nothing from the fridge is in it.
That is the level I would start at. Put in the things you always have and don't want to see on every shopping list. Add dates only for food you have actually thrown away before. Then look after a month at whether you kept it up to date.
The tool matters less than the habit. You can use Cooklang's pantry.conf (the Pantry plugin for Cook Editor gives it a proper view), a spreadsheet, or a notebook. The Pantry Management guide has every command.
None of this stops you picking up a third jar of cumin in the shop. But if the jars are in the file, the shopping list knows about them, and cumin stays off it.
-Alexey