Scan dependencies across multiple ecosystems with typosquat detection.
- Multi-ecosystem: Cargo, npm, PyPI, Go
- Typosquat detection: Levenshtein-based similarity check against known packages
- Multiple lockfile formats: Cargo.lock, package-lock.json, requirements.txt, go.mod, poetry.lock
- JSON output: For automation and CI integration
- Rich terminal output: Tables, panels, progress bars
pip install depscanOr from source:
git clone https://github.com/yunaremaia/depscan.git
cd depscan
pip install -e .# Scan current directory
depscan scan .
# Scan a specific path
depscan scan /path/to/project
# Output as JSON
depscan scan . --json-output > deps.json
# List all dependencies
depscan list-deps .
# Check a specific package
depscan check requests 2.28.0
# Show supported ecosystems
depscan info| Ecosystem | File | Status |
|---|---|---|
| Cargo | Cargo.lock | ✅ |
| npm | package-lock.json | ✅ |
| PyPI | requirements.txt | ✅ |
| PyPI | poetry.lock | ✅ |
| Go | go.mod | ✅ |
Scan a directory for dependencies and detect potential issues.
depscan scan . --typosquat # Enable typosquat detection (default)
depscan scan . --no-typosquat # Disable typosquat detection
depscan scan /path/to/project --json-output # JSON outputList all dependencies found in a directory.
depscan list-deps .
depscan list-deps /path/to/project --json-outputCheck a specific dependency name for typosquat potential.
depscan check raquests 1.0.0 # ⚠ Potential typosquat of "requests"
depscan check requests 2.28.0 # ✓ No issuesShow supported ecosystems and formats.
depscan uses Levenshtein edit distance to detect potential typosquats:
- Distance ≤ 2: Flagged as potential typosquat
- Known packages: Whitelisted to avoid false positives
- Ecosystem-aware: Checks against common package names
Example:
⚠ Potential typosquat detected!
raquests is similar to requests
{
"total": 42,
"typosquats": [
{
"name": "raquests",
"version": "1.0.0",
"target": "requests"
}
],
"by_ecosystem": {
"pypi": 25,
"npm": 17
}
}# Setup
git clone https://github.com/yunaremaia/depscan.git
cd depscan
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=depscanContributions welcome! See CONTRIBUTING.md for guidelines.
MIT