openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Bahn

A comprehensive suite of commands for tracking Deutsche Bahn trains

开发与 DevOps

作者:Jakub @ableitung

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.0

统计:⭐ 0 · 173 · 0 current installs · 0 all-time installs

0

安装量(当前) 0

🛡 VirusTotal :良性 · OpenClaw :良性

Package:ableitung/openclaw-bahn

安全扫描(ClawHub)

  • VirusTotal :良性
  • OpenClaw :良性

OpenClaw 评估

The skill's code, dependencies, and runtime instructions are coherent with its stated purpose of tracking Deutsche Bahn trains; it performs network calls to train data sources and writes a local connections file, but it does not request unrelated credentials or excessive privileges.

目的

Name/description match the code and declared dependencies: the skill fetches data from bahn.expert, IRIS (iris.noncd.db.de) and a Vendo client, uses fast-xml-parser and devalue as expected, and exposes station search, departures, journey, live, parse, predict and stats commands. Minor metadata inconsistency: registry metadata listed no homepage while SKILL.md references a GitHub repo — this is informational only and does not affect capability …

说明范围

SKILL.md instructs running the provided CLI (node scripts/bahn.mjs). The runtime instructions and code only read stdin or a user-specified file, parse connection text, and (expectedly) save parsed connections to connections/active.json. The code performs network requests only to train-data endpoints described in the README (bahn.expert, IRIS, and Vendo). No instructions ask the agent to read unrelated system files or environment secrets.

安装机制

Install spec is Node packages (db-vendo-client, devalue, fast-xml-parser) — a standard package manager flow. No arbitrary URL downloads or archive extraction were used. This is a moderate-but-expected install surface for a Node CLI.

证书

The skill requests no environment variables or credentials. All network access is to the external data sources necessary for train data. There are no unexplained secret requests or unrelated credential requirements.

持久

The skill writes a local file connections/active.json when parsing plaintext input (intended behavior for later --live/--stats usage). It does not request always:true or modify other skills. Users should be aware it will create/overwrite files in the working directory.

综合结论

This skill appears to do what it says: parse connection text, query train data from bahn.expert/IRIS/Vendo, optionally compute predictions, and write a local connections/active.json file. Before installing: (1) confirm you trust the remote endpoints (bahn.expert, iris.noncd.db.de and any Vendo API) since the skill makes network requests; (2) review the npm packages (db-vendo-client, devalue, fast-xml-parser) and their maintainers if you requir…

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Bahn」。简介:A comprehensive suite of commands for tracking Deutsche Bahn trains。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/ableitung/openclaw-bahn/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: bahn
description: A comprehensive suite of commands for tracking Deutsche Bahn trains
version: 1.0.0
metadata:
  openclaw:
    requires:
      bins:
        - node
    install:
      - kind: node
        package: db-vendo-client
      - kind: node
        package: devalue
      - kind: node
        package: fast-xml-parser
    emoji: "🚆"
    homepage: https://github.com/ableitung/openclaw-bahn
    os:
      - macos
      - linux
---

# Bahn

A comprehensive suite of commands for Deutsche Bahn trains - live departures, delay tracking, Baustellen/disruption alerts, journey planning, connection parsing, historical delay stats, and delay predictions. No API keys needed.

## Flags

| Flag | What it does | When to use |
|------|-------------|-------------|
| `--predict` | Runs the exponential delay model (transferProb, zugbindungProb) | User asks about probability of catching a transfer or Zugbindung being lifted |
| `--stats` | Fetches historical bahn.expert aggregate data per train | User asks about historical delay patterns for a specific train |

## Examples
```bash
# Search for a train station
node scripts/bahn.mjs --search "Wuppertal" [--json]

# Find latest departures from a given station
node scripts/bahn.mjs --departures "Wuppertal Hbf" [--results N] [--json]

# Default: Parse and show live data
echo '<raw Navigator share text>' | node scripts/bahn.mjs --parse [--json]

# With prediction model (transferProb, zugbindungProb)
echo '<text>' | node scripts/bahn.mjs --parse --predict [--json]

# With historical stats from bahn.expert
node scripts/bahn.mjs --parse connections/active.json --stats [--json]

# Both
node scripts/bahn.mjs --parse connections/active.json --predict --stats [--json]

# Find a given journey in timetable
node scripts/bahn.mjs --journey "From" "To" [--date YYYY-MM-DD] [--time HH:MM] [--results N] [--days N] [--json]

# Get current delays
node scripts/bahn.mjs --live --current-leg N [--delay M] connections/active.json [--json]

# Find a specific train by number and category (example: ICE 933)
node scripts/bahn.mjs --category CAT --train NUM [--date YYYY-MM-DD] [--json]
```

## File Layout

```
scripts/
├── bahn.mjs                    ← thin CLI dispatcher (~60 lines)
├── lib/
│   ├── commands/             ← one module per mode
│   │   ├── search.mjs        ← --search: station lookup
│   │   ├── departures.mjs    ← --departures: live departure board
│   │   ├── parse.mjs         ← --parse: connection parsing + enrichment
│   │   ├── journey.mjs       ← --journey: route search
│   │   ├── live.mjs          ← --live: real-time transfer check
│   │   └── track.mjs         ← --track: train tracking
│   ├── helpers.mjs           ← shared helpers (envelope, transfers, assessment)
│   ├── data.mjs              ← source router (IRIS/Vendo/bahn.expert)
│   ├── predict.mjs           ← probability model (opt-in via --predict)
│   ├── stats.mjs             ← delay profiles + historical stats (opt-in via --stats)
│   ├── parse.mjs             ← connection text parser
│   ├── format.mjs            ← output formatter
│   ├── messageLookup.mjs     ← IRIS delay code lookup
│   └── sources/
│       ├── bahn-expert.mjs   ← bahn.expert tRPC source
│       ├── iris.mjs          ← IRIS XML source
│       └── vendo.mjs         ← db-vendo-client source
```

## JSON Envelope

All modes support `--json`:

```json
{
  "mode": "string",
  "timestamp": "ISO8601",
  "connection": { "date", "from", "to", "legs", "transfers" },
  "journeyOptions": { "from", "to", "date", "options" },
  "departures": { "station", "entries" },
  "stations": { "query", "results" },
  "liveStatus": { "currentLeg", "nextTransfer", "zugbindungStatus", "recommendation", "remainingTransfers" },
  "trackStatus": { "train", "from", "to", "stops", "maxDelay", "zugbindungStatus" },
  "assessment": null,
  "errors": [],
  "warnings": []
}
```

The `assessment` field is only populated when `--predict` is used. Without it, `assessment` is `null`.

## Prediction Model (predict.mjs) — opt-in only

Exponential delay distributions per train category. Only loaded when `--predict` is passed.

| Category | Mean delay | Cancel rate |
|----------|-----------|-------------|
| ICE | 5.0min | 5.5% |
| IC/EC | 4.0min | 4.0% |
| RE | 2.5min | 2.0% |
| RB | 2.0min | 1.5% |
| S | 1.5min | 1.0% |
| Bus | 3.0min | 2.0% |

P(Zugbindung triggered) per leg = exp(-20/mean).
Overall P(Zugbindung) = 1 - ∏(1 - P(leg_i ≥ 20min)).

## Coverage

Long-distance (ICE/IC/EC), regional (RE/RB), S-Bahn, buses, and international trains to neighboring countries.


Report issues and legal information here: https://github.com/ableitung/openclaw-bahn