Offline dependency license audit for npm and Python
Lists dependencies from package.json, lockfiles, requirements.txt and pyproject.toml, reads declared licenses from installed files, and flags copyleft, restricted and unknown ones.
What it does
Lists a repository's dependencies and their declared licenses using only local files, with no network access.
- Reads
package.json,package-lock.json(v1 to v3),npm-shrinkwrap.json,yarn.lock(v1),requirements*.txt,pyproject.toml(PEP 621 and Poetry),poetry.lock,uv.lockandPipfile.lock - License sources: each package's
package.jsoninnode_modules, the lockfile license field,METADATAin site-packages (License-Expression, License, classifiers) and bundled LICENSE files - Finds virtualenvs inside the repository (such as
.venv) automatically - Classifies each license as permissive, weak copyleft (LGPL, MPL), strong copyleft (GPL), network copyleft (AGPL), restricted or unknown
- Writes
licenses.json,licenses.csv(opens in Excel) andreport.md; for CI it can exit with code 1 when chosen levels are present
How to use
python scripts/license_audit.py . --out ./license-audit
python scripts/license_audit.py . --no-dev --fail-on strong-copyleft,network-copyleft,unknown
The agent then verifies each flagged package and reports with evidence.
Requirements
- Python 3.11+ (standard library only; on 3.10 and older, TOML files are skipped)
- For accurate results, dependencies should be installed (
npm ci, orpip installinto a virtualenv)
Caveats
- This is not legal advice; get professional review for decisions.
- Packages that are not installed show as unknown.
- Python projects without a lockfile only list direct dependencies.
pnpm-lock.yamlis not parsed (only direct dependencies frompackage.jsonare listed).- It reads declared licenses only and does not inspect source files.
How to install
- Unzip the downloaded file (it contains a
dependency-license-audit/folder withSKILL.md). - Copy the whole folder into your agent's skills folder.
- Claude:
~/.claude/skills/(per project:.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills// Cursor:~/.cursor/skills/ - Claude app (claude.ai): upload the ZIP in Customize → Skills
- Claude:
- Restart the agent and check that the skill appears in its skill list.
Seller
AI Skill Market (official)
44 published skills