CLI frontend for https://openmensa.org
Go to file
Malte Tammena 9d8bdd9f71 chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
.github/workflows Update Readme with logo 2021-10-19 16:50:18 +02:00
src chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
static Fix logo 2022-06-26 16:01:41 +02:00
.envrc chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
.gitignore chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
Cargo.lock chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
Cargo.toml Minor version update 2022-06-26 16:50:09 +02:00
README.md Fix logo 2022-06-26 16:01:41 +02:00
README.tpl Update Readme with logo 2021-10-19 16:50:18 +02:00
config.toml Fix #15, don't panic on closed pipes 2021-10-27 15:03:04 +02:00
devshell.toml Bump version, update deps, use devshell 2021-10-27 13:21:53 +02:00
flake.lock chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
flake.nix chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00
projects.toml chore: Rewrite flake.nix 2023-04-15 00:39:46 +02:00

README.md

mensa CLI logo

tests

mensa

CLI tool to query the menu of canteens contained in the OpenMensa database.

Features

  • Runs on Linux, macOS and Windows.
  • Custom filters and favourites using CLI flags or the optional configuration file.
  • List canteens close to you based on GeoIP.
  • All request are cached locally.
  • Fuzzy date parsing based on date_time_parser.
  • List your favourite meals in canteens close to your location.
  • JSON Output

example

Installation

Cargo

Only nightly Rust supported at the moment.

$ cargo install --git https://github.com/MalteT/mensa

Nix

This is a Nix Flake, add it to your configuration or just test the application with:

$ nix run github:MalteT/mensa

Usage

See mensa --help.

  • mensa meals will show meals served today for the default canteen mentioned in the configuration. If no such configuration exists, try mensa meals --id 63. You can find the id for your canteen using
  • mensa canteens lists canteens near you based on your current IP in a default radius of 10km.
  • mensa tags will list the currently known meal tags like "12 Nuts".

Examples

Meals on monday (Click me!)

You can omit the -i/--id if you've configured a default id in the config.toml.

$ mensa meals -d mon -i 63

 Leipzig, Mensa am Park
 ┊ ╭───╴Bohnengemüse
 ┊ ├─╴Gemüsebeilage 🌱
 ┊ ╰╴( 0.55€ )
 ...
Canteens near your location (Click me!)
$ mensa canteens

70 Leipzig, Cafeteria Dittrichring
   Dittrichring 21, 04109 Leipzig

63 Leipzig, Mensa am Park
   Universitätsstraße 5, 04109 Leipzig
...
All currently known tags (Click me!)
$ mensa tags

   0 Acidifier
     Contains artificial acidifier

   1 Alcohol
     Contains alcohol

   2 Antioxidant
     Contains an antioxidant
  ...
Meals of canteens close to your location next sunday (Click me!)
$ mensa meals close --date sun

 Leipzig, Cafeteria Dittrichring
 ┊ ╭───╴Vegetarisch gefüllte Zucchini
 ┊ ├─╴Vegetarisches Gericht 🧀
 ┊ ├╴Rucola-Kartoffelpüree
 ┊ ├╴Tomaten-Ratatouille-Soße
 ┊ ╰╴( 2.65€ )  2 11 12 19

 Leipzig, Mensa am Park
 ┊ ╭───╴Apfelrotkohl
 ┊ ├─╴Gemüsebeilage 🌱
 ┊ ╰╴( 0.55€ )  2
 ...
Count OpenMensa's canteens (Click me!)
$ mensa canteens --all --json | jq '.[].id' | wc -l
704

Configuration (Optional)

See config.toml for an example. Copy the file to:

  • $XDG_CONFIG_DIR/mensa/config.toml on Linux,
  • $HOME/Library/Application Support/mensa/config.toml on macOS,
  • {FOLDERID_RoamingAppData}\mensa\config.toml on Windows

License: MIT