A command-line interface for De Lijn - Flemish public transport.
- Realtime departures - See when the next bus/tram arrives
- Stop search - Find stops by name
- Line search - Look up bus and tram lines
- Watch mode - Auto-refresh departures every 30 seconds
- Favorites - Save frequently used stops as aliases
- Multiple output formats - Human-readable, JSON, or plain TSV
brew install dedene/tap/delijngo install github.com/dedene/delijn-cli/cmd/delijn@latestgit clone https://github.com/dedene/delijn-cli.git
cd delijn-cli
make buildYou need a De Lijn API key. Get one free at data.delijn.be.
# Store your API key securely in the system keyring
delijn auth set-key
# Verify it's configured
delijn auth status# By stop number (6-digit)
delijn departures 200552
# By stop name (searches and picks)
delijn departures "Gent Sint-Pieters"
# Watch mode - refreshes every 30 seconds
delijn departures 200552 --watch
# Filter by line
delijn departures 200552 --line 1
# Limit results
delijn departures 200552 --limit 5# Search stops by name
delijn stops search "Gent Sint-Pieters"
# Get stop details by number
delijn stops get 200552# Search lines
delijn lines search "1"
# Get line details (entity number + line number)
delijn lines get 1 1# Save a favorite stop
delijn config set-favorite home 200552
# Use the favorite
delijn departures @home
# List all favorites
delijn config list-favorites# JSON output (for scripting)
delijn departures 200552 --json
# Plain TSV output
delijn departures 200552 --plain
# Disable colors
delijn departures 200552 --no-color
# Or set NO_COLOR=1 environment variable# Bash
delijn completion bash > /etc/bash_completion.d/delijn
# Zsh
delijn completion zsh > "${fpath[1]}/_delijn"
# Fish
delijn completion fish > ~/.config/fish/completions/delijn.fish| Variable | Description |
|---|---|
DELIJN_API_KEY |
API key (overrides keyring) |
DELIJN_KEYRING_BACKEND |
Keyring backend: keychain, file, pass |
NO_COLOR |
Disable colored output |
De Lijn API has two rate limits:
- Core API: 240 requests/minute (stops, lines, realtime)
- Search API: 6000 requests/minute
The CLI handles rate limiting automatically.
MIT - see LICENSE
Data provided by De Lijn Open Data.