Skip to content

CLI to query for public transport connections in switzerland

License

Notifications You must be signed in to change notification settings

sacovo/public-transport-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swiss Public Transport CLI

This is a simple tool to search public transport connections from one station to another, possible with a via.

It uses the public transportation data from https://opendata.ch and is written in rust.

Installation

cargo install spt_cli

Usage

spt_cli 0.1.5
Sandro Covo
CLI tool to query connections for swiss public transport

USAGE:
    spt_cli [OPTIONS] <TO> [VIA]

ARGS:
    <TO>     
    <VIA>    

OPTIONS:
    -c, --color              Always output colors
    -d, --date <DATE>        Date of connection, otherwise the current date is used
    -f, --from <FROM>        Starting point of journey, can be configured
    -h, --help               Print help information
    -i, --is-arrival-time    If set the given time is treated as arrival time, otherwise as
                             departure time
    -l, --limit <LIMIT>      Max. number of results, between 1 and 16
    -n, --no-color           Never output colors
    -t, --time <TIME>        Time of connection, otherwise the current time is used
    -V, --version            Print version information

Configuration

You can specify default values for from, limit and color in .config/spt_cli.json:

{
    "from": "Lenzburg",
    "limit": 1,
    "color": false
}

Examples

# Simple
spt_cli Zürich Bern

# Specify a time
spt_cli --time 10:00 Basel Chur

# Use a via
spt_cli Basel Genve Biel

spt_cli --help # show all options

Screen Recording

asciicast

Contribution

Issues and merge requests are welcome

About

CLI to query for public transport connections in switzerland

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages