一个全面的项目依赖和工具扫描器,用于检测项目中的第三方库、外部工具、包管理器和 GitHub 引用。
- 🔍 多语言支持: 支持 Python、JavaScript/Node.js、Java、Rust、Go、PHP、Ruby 等多种语言
- 📦 依赖检测: 自动检测项目中的第三方库和依赖
- 🛠️ 工具检测: 识别项目中使用的外部工具和 CLI 工具
- 📋 包管理器检测: 检测项目使用的包管理器
- 🔗 GitHub 引用: 扫描 GitHub Actions、子模块和其他 GitHub 引用
- 🔄 版本检查: 检查依赖的最新版本
- 📊 报告生成: 支持 JSON、HTML、Markdown 格式的报告
- 💾 备份管理: 更新前自动创建备份
# 从源码安装
git clone https://github.com/example/project-scanner.git
cd project-scanner
pip install -e .
# 或使用 pip
pip install project-scanner# 基本扫描
project-scanner scan /path/to/project
# 扫描并检查更新
project-scanner scan /path/to/project --check-updates
# 生成 HTML 报告
project-scanner scan /path/to/project -f html -o report.html# 检查更新(模拟模式)
project-scanner update /path/to/project --dry-run
# 执行更新
project-scanner update /path/to/project# 创建备份
project-scanner backup /path/to/project
# 列出备份
project-scanner list-backups
# 从备份恢复
project-scanner restore backup.zip /path/to/restore创建配置文件:
# 本地配置
project-scanner init
# 全局配置
project-scanner init --global配置示例 (project-scanner.yaml):
scan_depth: 3
include_dev_dependencies: true
check_for_updates: true
backup_before_update: true
output_format: json
exclude_patterns:
- node_modules
- __pycache__
- .git
- .venv
detectors:
library:
enabled: true
tool:
enabled: true
package_manager:
enabled: true
github:
enabled: true| 语言 | 包管理器 |
|---|---|
| Python | pip, Poetry, Pipenv, Conda |
| JavaScript/Node.js | npm, yarn, pnpm |
| Java | Maven, Gradle |
| Rust | Cargo |
| Go | Go Modules |
| PHP | Composer |
| Ruby | Bundler |
| .NET | NuGet |
| C++ | vcpkg, Conan |
# 安装开发依赖
pip install -r requirements.txt
# 运行测试
pytest tests/MIT License