PHPackages                             dominikb/composer-license-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dominikb/composer-license-checker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dominikb/composer-license-checker
=================================

Utility to check for licenses of dependencies and block/allow them.

3.0.0(2mo ago)574.6M↓26.3%15[1 issues](https://github.com/dominikb/composer-license-checker/issues)[1 PRs](https://github.com/dominikb/composer-license-checker/pulls)8MITPHPPHP ^8.2CI passing

Since Apr 6Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/dominikb/composer-license-checker)[ Packagist](https://packagist.org/packages/dominikb/composer-license-checker)[ Docs](https://github.com/dominikb/composer-license-checker)[ RSS](/packages/dominikb-composer-license-checker/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (20)Versions (19)Used By (8)

Composer License Checker
========================

[](#composer-license-checker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6e06043c4ab4fe52cede281c56e8636782bb356c9a2b4e390f10be38a9ac41da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d696e696b622f636f6d706f7365722d6c6963656e73652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominikb/composer-license-checker)![Build Status](https://camo.githubusercontent.com/a9d467eee7d929d702982aea898b058dce593777c5ede54b789fb3340f526d54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d696e696b622f636f6d706f7365722d6c6963656e73652d636865636b65722f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/b767be1b66235493a3c4c6b2bbdb6d990d0f211cf0c04136b9df1a087e9be6e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6d696e696b622f636f6d706f7365722d6c6963656e73652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominikb/composer-license-checker)

Quickly scan your dependencies, see what licenses they use or check in your CI that no unwanted licenses were merged.

The lookup of the summaries for every license done on .
Please inform yourself in more detail about the licenses you use and do not use the provided summary as your sole information.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require --dev dominikb/composer-license-checker
```

Usage
-----

[](#usage)

These commands are available:

- `./composer-license-checker report` - Create a report of all dependencies and their licenses
- `./composer-license-checker init` - Generate an `allowlist.txt` with all licenses found in your dependencies
- `./composer-license-checker check` - Check if any dependency violates your allowlist or blocklist

Use `./composer-license-checker help` to get info about general usage or use the syntax `./composer-license-checker help COMMAND_NAME` to see more information about a specific command available.

```
./vendor/bin/composer-license-checker report -p /path/to/your/project -c /path/to/composer.phar

./vendor/bin/composer-license-checker check \
        --allowlist allowlist.txt \ # Use the generated allowlist
        --allowlist MIT \ # Fail if anything but MIT license is used
        --blocklist GPL \ # Fail if any dependency uses GPL
        --allow dominikb/composer-license-checker # Always allow this dependency regardless of its license
```

#### Shared allowlist/blocklist

[](#shared-allowlistblocklist)

When using a filesource for your allowlist or blocklist you can also fetch them from a URI.

```
# Using a publicly available allowlist
./composer-license-checker check \
  --allowlist https://gist.githubusercontent.com/dominikb/671874857463bb08bab094edde20b8ca/raw/d415a9f96d9101205054e685eb61674393214b3f/allowlist.txt
```

### Path to composer

[](#path-to-composer)

By default, this tool assumes that "composer" is in your path and a valid command that will call Composer.

If that isn't the case, add the `-c` or `--composer` option with the path where to find Composer instead. This tool comes with Composer installed as a dependency, so you may start with `--composer ./vendor/bin/composer`, given that you are in this tool's root directory when executing a license check.

If this tool cannot find Composer, it will exit with status code 2, see below.

### Exit codes

[](#exit-codes)

Any command returns with one of these exit codes:

- 0: Ok
- 1: Offending licenses found in check, or a problem occurred when creating a report
- 2: Internal error when executing the command, may indicate problems calling Composer internally

### Dependencies without a license

[](#dependencies-without-a-license)

Some dependencies might not have a license specified in their `composer.json`. Those will be grouped under the license `none`.

```
# Reporting a dependency without a license will look like this
./composer-license-checker report --show-packages

#  Count 1 - none (-)
#  +-----+---------+------+
#  | CAN | CAN NOT | MUST |
#  +-----+---------+------+
#
#  packages: somepackage/without-a-license
```

You can add the imagined license `none` to your allowlist or blocklist to handle those dependencies.

```
# Allow dependencies without a license
./composer-license-checker check --allowlist none

# Disallow dependencies without a license
./composer-license-checker check --allowlist GPL --blocklist none
```

### Testing

[](#testing)

```
composer test
```

Code coverage reports are output to the `build` folder. See `.phpunit.xml.dist` for more testing configuration.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Dominik Bauernfeind](https://github.com/dominikb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

67

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity58

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 73.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~182 days

Recently: every ~218 days

Total

15

Last Release

87d ago

Major Versions

1.0.1 → 2.0.02020-07-07

2.7.0 → 3.0.02026-04-08

PHP version history (4 changes)1.0.0PHP ^7.1

2.1.0PHP ^7.3|^8.0

2.6.0PHP ^7.3 || ^8.0

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/79db2f786337fbf554ce667a0c267d81fe15f1091cb81d0d255c14ac78555a75?d=identicon)[dominikb](/maintainers/dominikb)

---

Top Contributors

[![dominikb](https://avatars.githubusercontent.com/u/28777818?v=4)](https://github.com/dominikb "dominikb (64 commits)")[![SvenRtbg](https://avatars.githubusercontent.com/u/416600?v=4)](https://github.com/SvenRtbg "SvenRtbg (11 commits)")[![ildyria](https://avatars.githubusercontent.com/u/627094?v=4)](https://github.com/ildyria "ildyria (2 commits)")[![keulinho](https://avatars.githubusercontent.com/u/15930605?v=4)](https://github.com/keulinho "keulinho (2 commits)")[![Furgas](https://avatars.githubusercontent.com/u/715407?v=4)](https://github.com/Furgas "Furgas (2 commits)")[![dkemper](https://avatars.githubusercontent.com/u/1893744?v=4)](https://github.com/dkemper "dkemper (1 commits)")[![konradmichalik](https://avatars.githubusercontent.com/u/4558190?v=4)](https://github.com/konradmichalik "konradmichalik (1 commits)")[![KristianI](https://avatars.githubusercontent.com/u/1626966?v=4)](https://github.com/KristianI "KristianI (1 commits)")[![manavo](https://avatars.githubusercontent.com/u/259487?v=4)](https://github.com/manavo "manavo (1 commits)")[![phansys](https://avatars.githubusercontent.com/u/1231441?v=4)](https://github.com/phansys "phansys (1 commits)")[![Jan-Walther-Basilicom](https://avatars.githubusercontent.com/u/92913571?v=4)](https://github.com/Jan-Walther-Basilicom "Jan-Walther-Basilicom (1 commits)")

---

Tags

cicomposerhacktoberfestopen-source-licensesdominikbcomposer-license-checker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dominikb-composer-license-checker/health.svg)

```
[![Health](https://phpackages.com/badges/dominikb-composer-license-checker/health.svg)](https://phpackages.com/packages/dominikb-composer-license-checker)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M577](/packages/shopware-core)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
