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
- Timetables: retrieve and display the current timetable for any SNCB station.
- Routes: Get detailed connections and travel times between two SNCB stations.
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.
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/
Commandtrein supports the following actions:
commandtrein <station> # shows timetable for station
Example:
commandtrein Gent-Sint-Pieters
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.
commandtrein search
To filter results, you will have to use tools like grep. Filtering is planned in upcoming releases
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.