travel-agent-cli 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "travel-agent-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "AI 驱动的旅行目的地推荐 Agent - 命令行工具(集成 FlyAI 旅行搜索)",
5
5
  "bin": {
6
6
  "travel-agent": "bin/cli.js",
@@ -159,6 +159,14 @@ class Settings(BaseSettings):
159
159
  @lru_cache()
160
160
  def get_settings() -> Settings:
161
161
  """获取配置单例"""
162
+ # 如果 .env 文件不存在,自动从 .env.example 创建
163
+ env_path = Path(__file__).parent.parent / ".env"
164
+ env_example_path = Path(__file__).parent.parent / ".env.example"
165
+
166
+ if not env_path.exists() and env_example_path.exists():
167
+ import shutil
168
+ shutil.copy(env_example_path, env_path)
169
+
162
170
  return Settings()
163
171
 
164
172