返回顶部
i

irail-cliirail命令行

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
712
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

irail-cli

irail-cli

通过 iRail API 为比利时铁路(NMBS/SNCB)提供的命令行工具。无需认证。

快速开始

bash

车站出发信息


irail liveboard Brugge

查找连接

irail connections Brugge Leuven

查看中断信息

irail disturbances

认证

无需认证。 iRail API 是公开且免费使用的。

核心规则

  1. 1. 始终使用 --json 进行程序化输出解析
  2. 车站名称灵活 - 支持部分匹配,多词名称使用引号
  3. 时间格式 - HH:MM(24小时制),日期格式 YYYY-MM-DD
  4. 语言选项 - nl、fr、en、de(默认:nl)

输出格式

标志格式使用场景
(默认)表格面向用户,带颜色
--json
JSON | 代理解析、脚本编写 |

颜色表示:红色 = 延误,黄色 = 站台变更。

工作流程

实时看板(出发/到达)

bash

车站出发信息


irail liveboard Brugge
irail liveboard Brussel-Centraal

到达信息(而非出发)

irail liveboard Brugge --arrivals

指定日期/时间

irail liveboard Brugge --time 09:00 --date 2025-02-15

脚本使用的 JSON 格式

irail liveboard Brugge --json

不同语言

irail liveboard Brugge --lang en

连接(路线规划)

bash

查找路线


irail connections Brugge Leuven

指定出发时间

irail connections Brugge Leuven --time 09:00

按到达时间(而非出发时间)

irail connections Brugge Leuven --time 14:00 --arrive-by

更多结果

irail connections Brugge Leuven --results 10

解析用的 JSON 格式

irail connections Brugge Leuven --json

车站

bash

列出所有车站


irail stations

搜索车站

irail stations --search bruss irail stations --search gent

脚本使用的 JSON 格式

irail stations --json

车辆(列车信息)

bash

显示列车信息


irail vehicle IC1832

包含所有停靠站

irail vehicle IC1832 --stops

JSON 输出

irail vehicle IC1832 --json

编组(列车车厢)

bash

显示列车编组(座位、设施)


irail composition S51507
irail composition IC1832

解析用的 JSON 格式

irail composition S51507 --json

中断信息

bash

所有当前中断


irail disturbances

仅计划内施工

irail disturbances --type planned

仅计划外中断

irail disturbances --type disturbance

脚本使用的 JSON 格式

irail disturbances --json

脚本示例

bash

获取前往目的地的下一班列车


irail connections Brugge Leuven --json | jq -r .[0].departure

查找车站 ID

irail stations --search brussel --json | jq -r .[0].id

检查实时看板是否有延误

irail liveboard Brugge --json | jq [.[] | select(.delay > 0)] | length

获取下一班出发列车的站台

irail liveboard Brugge --json | jq -r .[0].platform

列出所有中断

irail disturbances --json | jq -r .[].title

环境变量

变量描述
IRAILLANG默认语言(nl、fr、en、de)
IRAILJSON
默认使用 JSON 输出 | | NO_COLOR | 禁用彩色输出 |

语言选项

代码语言
nl荷兰语(默认)
fr
法语 | | en | 英语 | | de | 德语 |

bash
irail liveboard Brugge --lang fr
irail connections Brugge Leuven --lang en

命令参考

命令描述
liveboard车站出发/到达信息
connections
车站间路线规划 | | stations | 列出/搜索车站 | | vehicle | 列车信息和停靠站 | | composition | 列车车厢编组 | | disturbances | 服务中断信息 | | completion | Shell 补全 |

常见模式

检查列车是否延误

bash
irail vehicle IC1832 --json | jq .delay // 0

获取含换乘的连接

bash
irail connections Brugge Leuven --json | jq .[0].vias | length

仅查找直达列车

bash
irail connections Brugge Leuven --json | jq [.[] | select(.vias == null or (.vias | length) == 0)]

使用指南

  • - 无需认证 - API 公开可用
  • 在循环中使用 API 时注意频率 - 在请求之间添加延迟
  • 车站名称不区分大小写,支持部分匹配
  • 延误值以秒为单位(除以 60 转换为分钟)

安装

bash
brew install dedene/tap/irail

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 irail-1776420060 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 irail-1776420060 技能

通过命令行安装

skillhub install irail-1776420060

下载

⬇ 下载 irail-cli v1.0.1(免费)

文件大小: 2.44 KB | 发布时间: 2026-4-17 20:22

v1.0.1 最新 2026-4-17 20:22
- Added license, homepage, and author metadata to SKILL.md.
- Introduced explicit version ("1.1.0") in the metadata block.
- Declared OpenClaw requirements for binaries and installation methods (brew and go).
- Appended an Installation section with brew instructions at the end of SKILL.md.
- No changes made to CLI usage, workflows, or command documentation.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部