# db-cli
> A CLI for Deutsche Bahn train departures and journeys

## Summary
Command-line client for querying Deutsche Bahn train departures and journey connections.

## Capabilities
- Look up live departures from any Deutsche Bahn station
- Search journey connections between two stations
- Filter by transportation type (ICE, IC, RE, RB, S-Bahn, bus, etc.)
- Specify custom departure times and time windows
- Look up stations by name or station number
- Use current location to find nearby stations (macOS only)

## When to Use
- You need to quickly check train departures from a German station
- You want to find connections between two Deutsche Bahn stations from the terminal
- You prefer CLI tools over opening the DB Navigator app or website

## When NOT to Use
- You need to book tickets (this tool only shows schedules)
- You need train schedules outside of Germany
- You need real-time delay information beyond departure data

## Usage Patterns
### Check departures from a station
```
db-dep 'Berlin Hbf'
```
Shows upcoming departures from Berlin Hauptbahnhof

### Search for a journey
```
db-journey 'Berlin Hbf' 'München Hbf'
```
Finds connections from Berlin to Munich

### Departures with custom time
```
db-dep 'Köln Hbf' --when 'tomorrow 8am'
```
Shows departures from Cologne tomorrow morning

### Filter by transport type
```
db-journey 'Hamburg Hbf' 'Frankfurt Hbf' --products ICE,IC
```
Shows only long-distance train connections

## Installation
- **npm**: `npm install -g db-cli`

---
Source: https://littlescripts.sh/tools/db-cli
