#cli #command-line-tool #public-transport #munich #mvg #ubahn

app mvgfahrinfo

Get up-to-date departure times for Munich public transport in your terminal

5 stable releases

1.2.0 Oct 23, 2024
1.1.1 Mar 22, 2024
1.1.0 Nov 11, 2023
1.0.1 Nov 5, 2023
1.0.0 Nov 3, 2023

#157 in Command-line interface

Download history 17/week @ 2024-07-28 11/week @ 2024-09-22 125/week @ 2024-10-20 12/week @ 2024-10-27

137 downloads per month

MIT license

41KB
908 lines

MVG Fahrinfo

MVG Fahrinfo is a CLI tool to keep up-to-date with latest departure times of Munich public transport. The app is a native binary and uses official (albeit unpublished) MVG API.

It is made with Rust. πŸ¦€

It features:

  • Very low resource usage.
  • Beautiful terminal interface.
  • Automatic refreshing of departures.
  • Searching of stations.
  • Saving stations to file.
  • Real-life colors for vehicles for easier identification.
  • Easy navigation with shortcuts.

Using

Clone the repository and run cargo run in the root directory. In the first run, it will fetch the stations list from the server and save it to stations.json file.

To force update the stations list file, just delete the file and run the app again. The app will stay open in your terminal and will refresh the departures every 60 seconds.

To exit the app, press q or Ctrl+C.

Installing

To run it globally, you can install the app with cargo binstall mvgfahrinfo. Make sure you have binstall binstall repo installed. Once installed, you can invoke the app just by running mvgfahrinfo in the terminal. This is a binary crate and not a library, so you shouldn't use it as a dependency.

I might provide some pre-built binaries for Windows/MacOS/Linux in the future. :)

Shortcuts

Normal mode

  • tab - Switch between departures and stations list.
  • r - Refresh departures.
  • s - Search for a station.
  • Up/Down - Navigate through the list of stations.
  • Enter - Select a station.
  • q - Quit the app.
  • Ctrl+C - Quit the app.

Search mode

  • Esc - Exit search mode.
  • Up/Down - Navigate through the list of stations.
  • Enter - Select a station.

Screenshots

Current Departures in Munich Hauptbahnhof All stations list Station search

Credits

  • MVG for the API.
  • Ratatui for the beautiful terminal interface framework.

License

MIT

Limitations

Currently, the app only handles ASCII or 1 byte UTF-8 character input. If you are searching a station with non-ASCII characters (i.e. "â", "ß" etc.) in its name, the app will ignore the input. Please type the closest characters & scroll a bit down to select the station from the list (this will be fixed at a later version.)

Dependencies

~11–25MB
~368K SLoC