sbb-tui

command module
v1.13.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 8 Imported by: 0

README ΒΆ

SBB-TUI

TUI client for Switzerland's public transports timetables, inspired by the SBB/CFF/FFS app.

demo

✨ Features

  • πŸ“ Any station: search connections between any Swiss (and neighbouring) public transport stations
  • πŸš† Any transport: train, tram, bus, boat, cable cars (and even funiculars!)
  • 🧾 Detailed journey view with: transfers, platforms, delays, vehicle information and walk sections
  • ➑️ Autocompletion of station names
  • 🚩 CLI flags to pre-fill fields for quick lookups
  • 🧭 Clickable Google Maps links for walking sections
  • β‡Ή SBB brand styling with Nerd Font icons (Nerd Font recommended, Unicode fallback via --nerdfont=false)

πŸ“š Documentation

πŸ“¦ Install

Homebrew
brew install necrom4/tap/sbb-tui
Go
go install github.com/necrom4/sbb-tui
AUR
yay -S sbb-tui # or equivalent AUR package manager

[!NOTE] Or download your preferred executable from Releases directly.

Build from source
git clone https://github.com/necrom4/sbb-tui.git
cd sbb-tui
go build

[!WARNING] Due to the first release being v1.0.0, v1.X.X is considered experimental/unstable. What that mostly means is that breaking changes won't trigger a MAJOR version bump, but the CHANGELOG.md clearly documents them.

πŸš€ Usage

  1. Run sbb-tui
  2. Input departure and arrival locations (navigate with tab).
  3. Add optional information such as date, time, and whether those are for departure or arrival.
  4. Press Enter to view the results (navigate with arrows).

βš™οΈ Configuration

Add your optional config at $HOME/.config/sbb-tui/config.yaml

[!TIP] OS default config paths are also supported (such as ~/Library/Application Support/sbb-tui/config.yaml in macOS)

# default configuration
ui:
  nerdfont: true
  theme:
    text:            "#FFFFFF"
    textMuted:       "#888888"
    error:           "#D82E20"
    warning:         "#D82E20"
    borderFocused:   "#D82E20"
    borderUnfocused: "#484848"
    keysFg:          "#FFFFFF"
    keysBg:          "#484848"
    vehicleFg:       "#FFFFFF"
    vehicleBg:       "#2E3279"
    badgeModelFg:    "#FFFFFF"
    badgeModelBg:    "#D82E20"
    badgeCompanyFg:  "#484848"
    badgeCompanyBg:  "#FFFFFF"
    logo:            "#FFFFFF"

More themes can be found at docs/themes.md

🚩 Options

# sbb-tui --help
sbb-tui - Swiss SBB/CFF/FFS timetable app for the terminal

Usage:
  sbb-tui [flags]

Flags:
      --arrival       Use arrival time instead of departure time
      --date string   Pre-fill date (DD.MM.YYYY)
      --from string   Pre-fill departure station
      --nerdfont      Use Nerd Font icons (`=false` fallback to Unicode)
      --time string   Pre-fill time (HH:MM)
      --to string     Pre-fill arrival station
  -v, --version       Print version and exit

❓ Why

I travel 4 hours a day and often work from the train, passing through remote regions of Switzerland where loading the SBB website alone can take up to an entire minute before I've even had a chance to search for my next connection (back when I started building this, my cellular data plan provided me with 500kb/s at most in the city). On top of that, I love open source and disliked handing data over to corporations unnecessarily, so I loved the idea of a faster solution that only fetched the necessary data, the one I requested. One day, while exploring the idea of building my first TUI, I stumbled upon the incredible Swiss public transport API and I knew I'd found the perfect occasion to start!

🍻 HELP WANTED!

SBB-TUI is in constant improvement thanks to the work of many volunteers passionate about this little tool. This project is a very good playground for those who want to learn to collaborate in open source projects and improve the way they architecture their code and commit it. Whether you're a novice or a professional, don't be scared to hop on the train!

There's plenty of Issues of different complexity levels, many tagged with help wanted or good first issue. So if you're up for the challenge, read CONTRIBUTING.md, create your PR, and start coding!

Star History

Star History Chart

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
Package api provides HTTP client functions for the Swiss public transport API.
Package api provides HTTP client functions for the Swiss public transport API.
Package config handles application configuration and theming.
Package config handles application configuration and theming.
Package model defines data types for the Swiss public transport API responses.
Package model defines data types for the Swiss public transport API responses.
Package ui implements the Bubbletea TUI for SBB timetable queries.
Package ui implements the Bubbletea TUI for SBB timetable queries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL