FoodGram by Page Telegram Volunteer Services
!
FoodGram demo
A terminal food-and-drink journal written in Bash. Log what you ate or drank on
any date and time (including days already past), edit or add to earlier entries, record
ingredients, and write a
plain-text report you can open and print from a text editor or word processor.
Current version: v1.0.0 — see
CHANGELOG.md for release notes.
+--------------------------------------------------------------+
| FoodGram by Page Telegram Volunteer Services |
| Daily Food & Drink Journal |
+--------------------------------------------------------------+
[A] Add food or drink (any date / time)
[T] Today
[V] View / edit a day (add to past days here too)
[E] Edit an entry by #
[S] Search (name, ingredient, note)
[R] Printable report
[L] List everything
[Q] Quit
Requirements
| Tool | Purpose |
|---|
bash 4+ | Script host |
date (GNU) | Dates, times, “yesterday”, “3 days ago” |
fold | Word-wrap in reports (optional; lines still print without it) |
flock | Safe writes if two copies run at once (optional) |
No extra packages. Linux with GNU coreutils is enough.
Run
bash
chmod +x foodgram.sh
./foodgram.sh
On a pCloud (or other FUSE) folder the execute bit may not stick. Run it through bash instead:
bash
bash foodgram.sh
The menu is the usual way to work. Every action also has a command-line form.
bash
bash foodgram.sh --help
bash foodgram.sh add -k drink -m breakfast -g "coffee, milk" Coffee
bash foodgram.sh report --week --open
Add an entry
You can file something for
right now, or back-date it to any earlier clock time or calendar day.
Interactive (prompts for date, time, kind, meal, item, serving, ingredients, notes):
bash
./foodgram.sh add
One-shot:
bash
./foodgram.sh add -k drink -m breakfast -g "coffee, half-and-half" Coffee
./foodgram.sh add --date yesterday --time 19:10 --meal dinner \
--qty "1 bowl" --ingredients "beef, potatoes, carrots, onion" \
--notes "leftovers from Sunday" "Stew"
| Flag | Meaning |
|---|
-d, --date | today, yesterday, YYYY-MM-DD, or a GNU date phrase (3 days ago) |
-t, --time | 24-hour HH:MM (default: now) |
-k, --kind | food or drink |
-m, --meal | breakfast lunch dinner snack other |
-i, --item | Name (leftover words on the command line also become the name) |
-q, --qty | Serving / amount |
-g, --ingredients | Comma- or semicolon-separated list |
-n, --notes | Free text |
From the menu,
[A] Add offers your recent items by number so a daily coffee or usual breakfast is one keystroke.
Ingredients
Ingredients are their own field — not buried in the notes.
- One ingredient per line, or a single comma-separated list
- A blank line ends the list
- Stored and printed as a proper list on the report
When you edit an entry, the current ingredient line is pre-filled (readline). Type . on that line to re-enter them one per line.
Edit and add to prior days
Nothing is locked to “today.”
| Action | How |
|---|
| Add to a past day | ./foodgram.sh add --date yesterday or [V] View / edit a day → [A]dd |
| Change an entry | ./foodgram.sh edit 12 or pick from a day’s list |
| Move an entry to another time/day | Edit it; date and time are normal fields |
| Delete | ./foodgram.sh delete 12 (asks to confirm) |
| Repeat an old item later | ./foodgram.sh copy 12 today 08:15 or [C]opy in the day view |
[T] Today and [V] View / edit a day are a small browser: p / n move one day, g jumps to a date, and you can add, edit, delete, copy, or write that day’s report without leaving the screen.
bash
./foodgram.sh today
./foodgram.sh list yesterday
./foodgram.sh list all
./foodgram.sh view 2026-08-10
./foodgram.sh search peanut
Search looks in the item name, ingredients, and notes.
Printable report
Reports are
plain UTF-8 text, 72 columns wide — a comfortable line length for
US Letter (8.5 × 11 in) with about a 1-inch margin in a 12-point monospaced font. No PDF, no HTML: open the file and print.
bash
./foodgram.sh report # menu: today / day / week / month / range
./foodgram.sh report --today
./foodgram.sh report --date yesterday
./foodgram.sh report --week --open
./foodgram.sh report --month
./foodgram.sh report --from 2026-08-01 --to 2026-08-14
./foodgram.sh report --from 2026-08-01 --to 2026-08-14 -o ~/August-food.txt
./foodgram.sh report --stdout # print to the terminal only
Default files go to
data/reports/:
data/reports/FoodGram-2026-08-15.txt
data/reports/FoodGram-2026-08-08to2026-08-15.txt
Each report is grouped by
day → meal (breakfast, lunch, dinner, snacks, other). Every item shows serving, a bullet list of ingredients, and notes. Multi-day reports end with totals and an index of foods and drinks.
Printing from a text editor
Open the .txt file (Mousepad, gedit, nano, Vim, …).
Print. If the editor asks for a page size, choose US Letter.
Prefer a monospaced font so the rules line up.
Printing from a word processor
Open the .txt in LibreOffice Writer or Microsoft Word.
Page size: US Letter (8.5 × 11 in). Do not leave A4 selected.
Font: Courier New, Liberation Mono, or Consolas, 11 pt.
Margins: 0.75–1 inch on all sides.
Print.
--page-breaks inserts a form-feed between days; some editors and printers treat that as a new page.
--open launches
$FOODGRAM_EDITOR, then
$VISUAL /
$EDITOR, so you can land straight in the editor you print from.
Data
The journal is a tab-separated file next to the script (so a copy on pCloud keeps the log):
data/entries.tsv
data/reports/
Override the location:
bash
export FOODGRAM_HOME="$HOME/Documents/FoodGram"
./foodgram.sh
Columns:
id,
date,
time,
kind,
meal,
item,
quantity,
ingredients,
notes. You can open
entries.tsv in a spreadsheet if you want a raw dump.
Commands
foodgram.sh Interactive menu
foodgram.sh add [options] [item]
foodgram.sh edit [id|date]
foodgram.sh delete [id|date]
foodgram.sh copy <id> [date] [time]
foodgram.sh list [date|all|week]
foodgram.sh today
foodgram.sh search <text>
foodgram.sh report [options]
foodgram.sh view [date]
foodgram.sh help
Demo GIF
The animation at the top is a scripted session: add a drink (with ingredients), browse today and yesterday, search, and print a Letter-width report. Rebuild it with:
bash
python3 -m venv --system-site-packages /tmp/foodgram-demo-venv
/tmp/foodgram-demo-venv/bin/pip install pyte
/tmp/foodgram-demo-venv/bin/python tools/record_demo.py
The recorder uses a temporary
FOODGRAM_HOME; it does not touch
data/entries.tsv.