@ttthree/12306-cli
v0.1.0
Published
Command line client for querying 12306 tickets, stations, routes, and interline options.
Maintainers
Readme
12306 CLI
一个可发布到 npm 的 12306 命令行查询工具,参考 Joooook/12306-mcp 的公开 12306 查询能力实现。
安装
npm install -g @ttthree/12306-cli本地开发安装:
npm install
npm run build
npm link用法
12306 today
12306 skill
12306 station 北京南 上海虹桥
12306 city 北京
12306 tickets -d 2026-07-10 -f 北京 -t 上海 --filter G --sort duration --limit 5
12306 route G1033 -d 2026-07-10
12306 interline -d 2026-07-10 -f 北京 -t 昆明 --middle 武汉 --limit 3常用选项
--format text|csv|json: 输出格式。--filter GDZTKOFS: 车次筛选,G高铁/城际,D动车,Z/T/K对应车次类型,O其他,F复兴号,S智能动车组。--earliest <hour>/--latest <hour>: 出发时间小时范围,取值0-24。--sort startTime|arriveTime|duration: 排序字段。--reverse: 反向排序。--limit <n>: 限制返回数量。
发布到 npm
npm login
npm run check
npm pack --dry-run
npm publish --access public包名已设置为 @ttthree/12306-cli,全局命令仍然是 12306。
