Skip to content

CLI tool for real-time SNCB timetables and routes.

License

Notifications You must be signed in to change notification settings

Kaya-Sem/commandtrein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commandtrein

Build

Commandtrein is a command-line interface (CLI) tool designed to access and display timetables and route information for SNCB (Belgian Railways) directly from your terminal.

See also: commandlijn

Features

  • Timetables: retrieve and display the current timetable for any SNCB station.
  • Routes: Get detailed connections and travel times between two SNCB stations.

image

Installation

1. Install via go install

To quickly install commandtrein using go, run the following command:

go install github.com/Kaya-Sem/commandtrein@latest

This will download and install commandtrein and make it avaible in your $GOPATH/bin directory. Ensure that this directory is included in your system's PATH environment variable.

2. Install from source

If you prefer to build commandtrein from source, follow these steps:

git clone https://github.com/Kaya-Sem/commandtrein.git
cd commandtrein
go build -o commandtrein
sudo mv commandtrein /usr/local/bin/

Usage

Commandtrein supports the following actions:

Display timetable / liveboard for a station

commandtrein <station> # shows timetable for station

Example:

commandtrein Gent-Sint-Pieters

Find connections between two stations

commandtrein <station1> to <name2>

Example:

commandtrein Gent-Sint-Pieters to Zingem

this command will display the avaible connections, including departure and arrival times, duration, and platform information.

List all SNCB stations

commandtrein search

To filter results, you will have to use tools like grep. Filtering is planned in upcoming releases

Acknowledgements

Commandtrein leverages the iRails API, an open-source API for accessing real-time data from SNCB. We extend our thanks to the iRails team for their excellent service.