Deutsche Bahn CLI
@tobiasbischoff
npx machina-cli add skill @tobiasbischoff/bahn --openclawDeutsche Bahn CLI
Search train connections using the bahn-cli tool.
Installation
The tool should be installed globally or in the workspace. If not installed:
cd ~/Code/bahn-cli && npm install
Usage
Search train connections:
cd ~/Code/bahn-cli && node index.js search "<from>" "<to>" [options]
Options
--date YYYY-MM-DD- Departure date (default: today)--time HH:MM- Departure time (default: current time)--results <number>- Number of results to show (default: 5)
Examples
Search connections from Hannover to Bonn:
cd ~/Code/bahn-cli && node index.js search "Hannover Hbf" "Bonn Hbf" --results 3
Search with specific date and time:
cd ~/Code/bahn-cli && node index.js search "Berlin" "München" --date 2026-02-05 --time 14:30
Station Names
- Use common German station names
- "Hbf" means Hauptbahnhof (main station)
- Examples: "Berlin Hbf", "München Hbf", "Frankfurt(Main)Hbf", "Köln Hbf"
- Station names are case-insensitive
Output
The tool shows:
- Departure and arrival times
- Platform numbers
- Duration
- Number of changes
- Intermediate stops for connections with changes
- Train numbers (ICE, IC, RE, etc.)
Notes
- The CLI uses the db-vendo-client library
- Some station names in output may show "undefined" (cosmetic issue, doesn't affect functionality)
- Direct connections are listed first
- Times are in 24-hour format
Overview
This skill lets you search German train connections using the bahn-cli tool. It supports station names like Berlin Hbf, München Hbf, and Köln Hbf to quickly plan trips, check departure times, durations, and changes.
How This Skill Works
Install bahn-cli globally or in your workspace, then run node index.js search "<from>" "<to>" [options]. The CLI uses the db-vendo-client library and returns results with departure/arrival times, platforms, duration, number of changes, and train numbers, prioritizing direct connections.
When to Use It
- When you need to find a train connection between two German stations for travel planning
- When you want to check departure times for a specific date and time
- When you want to limit the number of results shown
- When comparing direct connections first and reviewing changes
- When you need to see intermediate stops and train numbers for changes
Quick Start
- Step 1: Install bahn-cli in your project directory (cd ~/Code/bahn-cli && npm install)
- Step 2: Run a search with your from and to stations, e.g., node index.js search Berlin Hbf München Hbf
- Step 3: Use --date, --time, and --results to tailor the output
Best Practices
- Use common station names like Berlin Hbf, München Hbf, Frankfurt(Main)Hbf, Köln Hbf
- Pass a specific date and time with --date and --time to target your trip
- Rely on direct connections first as the CLI lists them upfront
- Remember station names are case-insensitive and use Hbf for Hauptbahnhof
- Review intermediate stops and train numbers for connections with changes
Example Use Cases
- Search Hannover Hbf to Bonn Hbf with --results 3
- Search Berlin to München with --date 2026-02-05 --time 14:30
- Search Berlin Hbf to Hamburg Hbf with default settings
- Search Frankfurt(Main)Hbf to Köln Hbf with --results 5
- Search München Hbf to Stuttgart Hbf to view changes and durations