3-in-1 China 12306 query — tickets, route stops, transfer plans. Zero login. Filter 高铁/动车/火车 by type, time, duration. Pure Python, text/json/csv output. 火车票/...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install trainclaw或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install trainclaw⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/trainclaw/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: trainclaw description: 3-in-1 China 12306 query — tickets, route stops, transfer plans. Zero login. Filter 高铁/动车/火车 by type, time, duration. Pure Python, text/json/csv output. 火车票/余票/经停站/中转换乘. version: 0.0.7 icon: 🚄 ---
3-in-1 China 12306 query: tickets + route stops + transfer plans, zero login. 三合一 12306 查询:余票 + 经停站 + 中转换乘,零登录。
调用 trainclaw.py 一条命令完成查询。无需登录、无需API Key、无需额外配置——仅依赖 Python + requests,开箱即用。支持车次类型筛选、时间窗口、排序,text/json/csv 多格式输出。
One command via trainclaw.py. No login, no API key, no extra config — just Python + requests, ready to go. Filter by train type, time window, sort by duration. Output: text / json / csv.
用户提到火车票、高铁票、动车票、车次查询、余票、经停站、中转换乘、12306等关键词时触发。
Trigger when user mentions train tickets, bullet train, remaining tickets, route stops, transfer, 12306, China rail, etc.
用户说:"查明天北京到上海的高铁"
↓
提取参数:出发=北京,到达=上海,日期=明天,类型=G
↓
执行命令:
python trainclaw.py query -f 北京 -t 上海 -d 2026-03-04 --type G
↓
返回余票信息(text 格式,直接展示给用户)
查询两站之间的余票信息,支持筛选和排序。
# 基础查询
python trainclaw.py query -f 北京 -t 上海
# 完整参数
python trainclaw.py query -f 北京 -t 上海 -d 2026-03-04 \
--type G --earliest 8 --latest 18 --sort duration -n 10 -o text
查询某车次的所有经停站信息。
python trainclaw.py route -c G1033 -d 2026-03-04
python trainclaw.py route -c G1 -d 2026-03-04 -o json
查询需要换乘的中转方案。
# 自动推荐中转站
python trainclaw.py transfer -f 深圳 -t 拉萨 -n 5
# 指定中转站
python trainclaw.py transfer -f 深圳 -t 拉萨 -m 西安 -d 2026-03-04
| 参数 | 说明 | 默认值 | |------|------|--------| | -d, --date | 查询日期 (yyyy-MM-dd) | 今天 | | -o, --format | 输出格式: text / json / csv | text |
| 参数 | 说明 | 默认值 | |------|------|--------| | -f, --from | 出发站(站名/城市名/三字母代码) | 必填 | | -t, --to | 到达站(站名/城市名/三字母代码) | 必填 | | --type | 车次类型筛选(见下表) | 不筛选 | | --earliest | 最早出发小时 (0-24) | 0 | | --latest | 最晚出发小时 (0-24) | 24 | | --sort | 排序: startTime / arriveTime / duration | 不排序 | | --reverse | 倒序排列 | 否 | | -n, --limit | 最大结果数 | query: 不限, transfer: 10 |
| 代码 | 含义 | |------|------| | G | 高铁/城际(G/C 开头) | | D | 动车 | | Z | 直达特快 | | T | 特快 | | K | 快速 | | O | 其他(非 GDZTK) | | F | 复兴号 | | S | 智能动车组 |
可组合使用,如 --type GD 表示高铁+动车。
支持三种输入格式,自动识别:
北京南、上海虹桥、南京南 → 直接匹配北京、上海、南京 → 匹配该城市代表站BJP、SHH、NJH → 直接使用车次 | 出发站→到达站 | 出发→到达 | 历时 | 席位信息 | 标签
G25 | 北京南→上海虹桥 | 17:00→21:18 | 04:18 | 商务座:1张/2318.0元, 一等座:有票/1060.0元 | 复兴号
完整 JSON 数组,包含所有字段。
标准 CSV,含表头行。
trainclaw.pyconfig.pycache/(车站数据自动缓存 7 天)requests 库用户: "明天北京到上海有什么高铁?"
→ python trainclaw.py query -f 北京 -t 上海 -d {明天日期} --type G
用户: "上午 8 点到 12 点从南京到杭州的动车"
→ python trainclaw.py query -f 南京 -t 杭州 --type D --earliest 8 --latest 12
用户: "G1033 都停哪些站?"
→ python trainclaw.py route -c G1033 -d {今天日期}
用户: "从北京怎么坐火车去成都?"
→ python trainclaw.py transfer -f 北京 -t 成都 -n 5
公益技能,免费开源。 / Community-driven, open-source, free for everyone.
安装 TrainClaw 后,可以对 AI 说这些话来触发它
Help me get started with TrainClaw
Explains what TrainClaw does, walks through the setup, and runs a quick demo based on your current project
Use TrainClaw to 3-in-1 China 12306 query — tickets, route stops, transfer plans
Invokes TrainClaw with the right parameters and returns the result directly in the conversation
What can I do with TrainClaw in my developer & devops workflow?
Lists the top use cases for TrainClaw, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/trainclaw/ 目录(个人级,所有项目可用),或 .claude/skills/trainclaw/(项目级)。重启 AI 客户端后,用 /trainclaw 主动调用,或让 AI 根据上下文自动发现并使用。
TrainClaw 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
TrainClaw 可免费安装使用。请查阅仓库了解许可证信息。
3-in-1 China 12306 query — tickets, route stops, transfer plans. Zero login. Filter 高铁/动车/火车 by type, time, duration. Pure Python, text/json/csv output. 火车票/...
TrainClaw 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using TrainClaw
Identifies repetitive steps in your workflow and sets up TrainClaw to handle them automatically