🎯 解决问题: - 避免推荐用户系统中不存在的工具 - 防止因缺失工具导致的命令执行失败 - 提供更安全、更灵活的现代化命令管理 🔧 主要改进: - 新增 ai_shell/modern_commands.toml 配置文件 - 智能检测系统中已安装的现代化工具 - 只推荐实际可用的工具,安全回退到原始命令 - 完整的工具描述、分类和安装提示 📦 配置文件特性: - 28 个命令映射配置 - 20 个工具描述说明 - 8 个工具分类组织 - 6 个详细安装提示 🛠️ 新增管理工具: - scripts/manage_modern_commands.py 配置管理脚本 - 支持验证、列表、安装建议等功能 - 完整的配置状态检查和报告 🔍 用户体验优化: - ai --config 显示详细的工具状态 - 区分已启用、保持原样、未安装的工具 - 提供具体的安装命令和说明 - 支持环境变量和配置文件自定义 🛡️ 安全保障: - 绝不推荐不存在的工具 - 优雅降级到原始命令 - 保持完全向后兼容性 📋 技术实现: - 添加 tomli 依赖支持 TOML 解析 - 重构配置加载逻辑 - 智能工具检测和状态管理 - 完善的错误处理和回退机制
48 lines
1.2 KiB
TOML
48 lines
1.2 KiB
TOML
[project]
|
|
name = "ai-shell"
|
|
version = "0.2.0"
|
|
description = "AI-powered shell command generator using DeepSeek V3"
|
|
authors = [
|
|
{name = "AI Shell Team", email = "ai-shell@example.com"}
|
|
]
|
|
readme = "README.md"
|
|
license = {text = "MIT"}
|
|
keywords = ["ai", "shell", "command", "generator", "deepseek"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Intended Audience :: Developers",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
"Topic :: System :: Shells",
|
|
]
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"pydantic-ai",
|
|
"openai",
|
|
"requests>=2.32.4",
|
|
"python-dotenv>=1.0.0",
|
|
"tomli>=1.2.0; python_version<'3.11'",
|
|
]
|
|
|
|
[project.scripts]
|
|
ai = "ai_shell.main:main"
|
|
|
|
[project.urls]
|
|
Homepage = "https://github.com/your-username/ai-shell"
|
|
Repository = "https://github.com/your-username/ai-shell"
|
|
Issues = "https://github.com/your-username/ai-shell/issues"
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["ai_shell"]
|
|
|
|
[tool.hatch.version]
|
|
path = "ai_shell/__init__.py"
|
|
|
|
# UV 配置已移至 uv.toml 文件
|