Scan project dependencies for license compatibility issues across multiple ecosystems.
bash
# Basic scan (permissive policy)
python3 scripts/license_audit.py /path/to/project
# Strict enterprise scan with CI exit codes
python3 scripts/license_audit.py /path/to/project --policy permissive --ci --format markdown
# Allow weak copyleft (LGPL, MPL)
python3 scripts/license_audit.py /path/to/project --policy weak-copyleft
# Include transitive deps (npm)
python3 scripts/license_audit.py /path/to/project --include-transitive
# JSON output for tooling
python3 scripts/license_audit.py /path/to/project --format json
EcosystemFiles ParsedLicense Sourcenpmpackage.json, package-lock.json, node_modules/*/package.jsonPackage metadatapiprequirements.txt, Pipfile, pyproject.tomlInstalled package metadataGogo.modManual/UNKNOWN (no local metadata)RustCargo.tomlManual/UNKNOWN (no local metadata)RubyGemfileManual/UNKNOWN (no local metadata)
npm and pip auto-detect licenses from installed packages. Go/Rust/Ruby report UNKNOWN unless packages are installed — review manually.
PolicyAllowsUse Whenpermissive (default)MIT, Apache-2.0, BSD, ISC, etc.Proprietary/commercial projectsweak-copyleft+ LGPL, MPL, EPLLibrary consumers (dynamic linking)any-openAll OSI-approvedOpen-source projectscustomUser-definedEnterprise with specific requirements
For custom policy setup, see references/custom-policy.md.
text — Human-readable terminal output (default)json — Machine-readable for CI pipelines and toolingmarkdown — Report with tables, suitable for PRs or documentationWith --ci flag:
0 — No issues1 — Warnings only (unknown licenses)2 — Policy violations foundThe scanner classifies licenses into categories:
SPDX expressions ( MIT OR Apache-2.0, MIT AND BSD-3-Clause) are evaluated: OR picks most permissive, AND picks most restrictive.
.license-policy.json for custom rules--ci flag to CI pipeline for automated enforcement