Rajasthan Helper CLI – 真实天气、节日与旅行提示,基于免费 GitHub Copilot CLI 构建
发布: (2026年2月10日 GMT+8 01:31)
2 分钟阅读
原文: Dev.to
Source: Dev.to
概览
Rajasthan Helper CLI 是一个彩色、面向终端的工具,可将 Rajasthan/India 旅行信息直接带到你的命令行中。
功能
- weather [city] – 使用免费 wttr.in API 实时获取天气(温度、天气状况、体感温度、湿度、风速)。
- festival [month] – 列出 Rajasthan 主要节日及其信息和表情符号(如 Holi、Diwali、Teej、Pushkar Fair 等)。
- tip [city] – 为 10 多个城市(Jaipur、Udaipur、Delhi、Jodhpur、Jaisalmer 等)提供精选旅行与美食攻略。
所有功能全部基于 GitHub Copilot CLI 免费层,通过大约 20 条智能提示完成——无需付费订阅,也不需要信用卡。
实现细节
- 通过
npm install -g @github/copilot安装并使用免费 GitHub 账户登录。 - 使用
/init初始化项目,生成instructions.md以保持风格一致。 - 使用单个大型提示生成基于 Click 的命令结构,然后通过有针对性的后续提示调试打包问题(TOML 重复、缺失文件夹、导入错误)。
- 集成 wttr.in API 并为彩色输出添加丰富的终端格式化。
整个过程约用了 20 条提示,展示了使用免费 Copilot 资源快速构建功能性 CLI 的可能性。
使用示例
# Show help
rajasthan-helper --help
# Get weather for Jaipur
rajasthan-helper weather jaipur
# List festivals in March
rajasthan-helper festival march
# Get travel tips for Udaipur
rajasthan-helper tip udaipur
该 CLI 会显示彩色天气面板、带表情符号的节日卡片以及旅行攻略列表。
仓库
源码可在以下地址获取:
https://github.com/Chetan-code-lrca/rajasthan-helper
致谢
感谢 GitHub Copilot CLI 挑战提供了精彩的学习旅程!
作者:Chetan Inaganti (@Chetan007329)