License compliance checker for your projects. Scan dependencies, detect problematic licenses, and ensure your project stays compliant.
Perfect for enterprises, open source maintainers, and anyone who cares about license compliance.
- π¦ Multi-ecosystem support - npm, pip, Go modules, Cargo
- π Smart scanning - Detects licenses from package metadata and LICENSE files
β οΈ Compliance warnings - Alerts for GPL in MIT projects, AGPL for SaaS, etc.- π Multiple output formats - Table view for humans, JSON for CI/CD
- π¦ CI-friendly exit codes - Integrates with any pipeline
- π― Customizable rules - Allow/deny specific licenses
# Install globally
npm install -g license-guard
# Scan current directory
license-guard scan
# Scan with specific project license
license-guard scan --license MIT
# Quick check for CI
license-guard check
# JSON output for processing
license-guard scan --format json# Scan current directory
license-guard scan
# Scan specific path
license-guard scan /path/to/project
# Specify your project's license for compatibility checking
license-guard scan --license Apache-2.0
# Strict mode - fail on any warning
license-guard scan --strict# Allow specific licenses
license-guard scan --allow LGPL-3.0 --allow MPL-2.0
# Deny specific licenses
license-guard scan --deny AGPL-3.0 --deny GPL-3.0# Human-readable table (default)
license-guard scan
# JSON for CI/CD pipelines
license-guard scan --format json# Quick compliance check
# Exit code 0: All OK
# Exit code 1: Warnings found (with --strict)
# Exit code 2: Violations found
license-guard check# Show common license information
license-guard licensesimport { scan, checkCompliance } from 'license-guard';
// Scan a project
const results = await scan('./my-project');
// Check compliance
const compliance = checkCompliance(results.dependencies, {
projectLicense: 'MIT',
allowList: ['LGPL-3.0'],
denyList: ['AGPL-3.0']
});
console.log(`Found ${compliance.violations.length} violations`);| Code | Meaning |
|---|---|
| 0 | Success - No issues found |
| 1 | Warnings found (with --strict flag) |
| 2 | Violations found - License incompatibility detected |
name: License Check
on: [push, pull_request]
jobs:
license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npx license-guard checklicense-check:
image: node:20
script:
- npm ci
- npx license-guard check --strictMIT, ISC, BSD-2-Clause, BSD-3-Clause, Apache-2.0, Unlicense, CC0-1.0, Zlib
LGPL-3.0, MPL-2.0, EPL-2.0, CDDL-1.0
GPL-2.0, GPL-3.0, AGPL-3.0
SSPL-1.0, CC-BY-NC, BSL-1.0
Need advanced compliance features for your enterprise? License Guard Pro includes:
| Feature | Free | Pro |
|---|---|---|
| Dependency scanning | β | β |
| License detection | β | β |
| Compliance warnings | β | β |
| JSON/Table output | β | β |
| CI exit codes | β | β |
| SBOM Generation (SPDX/CycloneDX) | β | β |
| License Policy Engine | β | β |
| Multi-Project Scanning | β | β |
| Compliance Reports (PDF/HTML) | β | β |
| Slack/Teams Integration | β | β |
| Historical Tracking | β | β |
| SSO/SAML Support | β | β |
| Priority Support | β | β |
π Learn more about Pro features
π§ Contact: Open an issue for enterprise inquiries
Contributions are welcome! Please read our Contributing Guide for details.
# Clone the repo
git clone https://github.com/DebuggingMax/license-guard.git
# Install dependencies
npm install
# Run tests
npm testMIT Β© DebuggingMax
Made with β€οΈ for the open source community
π Sponsor this project